1
0

Dockerfile 462 B

123456789101112131415
  1. FROM golang:alpine AS builder
  2. RUN apk --no-cache --no-progress add make upx
  3. WORKDIR /go/src/lolcathost/pathway/
  4. COPY *.go VERSION ./
  5. RUN echo Building && \
  6. env CGO_ENABLED=0 go build -trimpath -ldflags="all=-s -w -buildid= -X main.version=$(cat VERSION) -X main.buildtime=$(date +%FT%T%z)" && \
  7. echo Compressing && \
  8. upx pathway > /dev/null
  9. FROM scratch
  10. COPY --from=builder /go/src/lolcathost/pathway/pathway /pathway
  11. EXPOSE 8080
  12. CMD ["/pathway"]