Last active
April 15, 2020 07:29
-
-
Save zeusro/516f5946af6a2770e89e1840047a08ec to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM golang:1.14.0-alpine3.11 as build-env | |
ADD . /src/github.com/${project} | |
# UFS cache | |
RUN apk update | |
WORKDIR /src/github.com/${project} | |
RUN GOARCH=amd64 CGO_ENABLED=0 go build -mod vendor -o ${app} github.com/${project} | |
# use the second image to minimize the size of the docker image | |
FROM alpine:3.11 | |
COPY --from=build-env /src/github.com/${project}/${app} /app/${app} | |
WORKDIR /app | |
ENTRYPOINT ["/app/${app}"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment