FROM golang:alpine AS builder RUN apk --no-cache --no-progress add upx WORKDIR /go/build COPY . . RUN echo Building && \ go get -u && \ env CGO_ENABLED=0 go build -trimpath -ldflags="all=-s -w -buildid= -X main.version=v$(cat VERSION) -X main.buildtime=$(date +%FT%T%z)" -o pathway && \ echo Compressing && \ upx pathway > /dev/null FROM scratch COPY --from=builder /go/build/pathway /pathway EXPOSE 8080 CMD ["/pathway"]