From 48d9c19d8ca44d352d76a88177b0f034c9d465db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=20Gl=C3=A4=C3=9F-St=C3=B6cker?= Date: Wed, 26 Oct 2022 20:41:14 +0200 Subject: [PATCH 1/2] hopefully fixed the go get deprecation stuff --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 765d56b..7f1d5bc 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,8 +1,8 @@ # build stage FROM golang:alpine AS build-env RUN apk --no-cache add build-base git gcc -RUN go get github.com/ThomasLeister/prosody-filer -RUN cd $GOPATH/src/github.com/ThomasLeister/prosody-filer; \ +RUN cd /tmp; git clone https://github.com/ThomasLeister/prosody-filer.git +RUN cd /tmp/prosody-filer; \ VERSIONSTRING="$(git describe --tags --exact-match || git rev-parse --short HEAD)"; \ echo "Building version ${VERSIONSTRING} of Prosody-Filer ..." \ ./build.sh @@ -10,5 +10,5 @@ RUN cd $GOPATH/src/github.com/ThomasLeister/prosody-filer; \ # final stage FROM alpine WORKDIR /app -COPY --from=build-env /go/bin/prosody-filer /app/ +COPY --from=build-env /tmp/prosody-filer/prosody-filer /app/ ENTRYPOINT /app/prosody-filer From f1d6ae9509b946ebac32422b531a4d75855b851f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=20Gl=C3=A4=C3=9F-St=C3=B6cker?= Date: Wed, 26 Oct 2022 21:56:38 +0200 Subject: [PATCH 2/2] don't use the vendor build.sh file anymore and get rid of a git-version-tag related error --- Dockerfile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 7f1d5bc..16e87d6 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,9 @@ FROM golang:alpine AS build-env RUN apk --no-cache add build-base git gcc RUN cd /tmp; git clone https://github.com/ThomasLeister/prosody-filer.git RUN cd /tmp/prosody-filer; \ - VERSIONSTRING="$(git describe --tags --exact-match || git rev-parse --short HEAD)"; \ - echo "Building version ${VERSIONSTRING} of Prosody-Filer ..." \ - ./build.sh + VERSIONSTRING="$(git describe --tags --exact-match 2> /dev/null || git rev-parse --short HEAD)"; \ + echo "Building version ${VERSIONSTRING} of Prosody-Filer ..."; \ + CGO_ENABLED=0 GOOS=linux go build -a -ldflags "-extldflags '-static' -w -s -X main.versionString=${VERSIONSTRING}" prosody-filer.go; # final stage FROM alpine