Private
Public Access
0
0

include an example cmd

This commit is contained in:
teizz
2021-10-24 13:58:11 +02:00
parent 53013812a9
commit c3e6bf0987
7 changed files with 79 additions and 9 deletions

16
cmd/Dockerfile Normal file
View File

@@ -0,0 +1,16 @@
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"]