diff --git a/Dockerfile b/Dockerfile index 16e87d6..765d56b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,14 +1,14 @@ # build stage 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 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; +RUN go get github.com/ThomasLeister/prosody-filer +RUN cd $GOPATH/src/github.com/ThomasLeister/prosody-filer; \ + VERSIONSTRING="$(git describe --tags --exact-match || git rev-parse --short HEAD)"; \ + echo "Building version ${VERSIONSTRING} of Prosody-Filer ..." \ + ./build.sh # final stage FROM alpine WORKDIR /app -COPY --from=build-env /tmp/prosody-filer/prosody-filer /app/ +COPY --from=build-env /go/bin/prosody-filer /app/ ENTRYPOINT /app/prosody-filer