1
0

Dockerfile 441 B

12345678910111213141516
  1. FROM golang:alpine AS builder
  2. RUN apk --no-cache --no-progress add upx
  3. WORKDIR /go/build
  4. COPY . .
  5. RUN echo Building && \
  6. go get -u && \
  7. 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 && \
  8. echo Compressing && \
  9. upx pathway > /dev/null
  10. FROM scratch
  11. COPY --from=builder /go/build/pathway /pathway
  12. EXPOSE 8080
  13. CMD ["/pathway"]