Created
May 18, 2020 19:39
-
-
Save airtonGit/3952a6e2d3fc08197846cd3e5e3c63ee to your computer and use it in GitHub Desktop.
Exemplo de Dockerfile para gerar imagem de microserviço em GO
This file contains hidden or 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 as build-env | |
WORKDIR /app | |
ADD ./vendor/* /go/src/github.com/ | |
ADD . /app | |
ENV GOOS=linux | |
ENV GOARCH=amd64 | |
ENV CGO_ENABLED=0 | |
RUN cd /app && go build -o app | |
FROM scratch | |
ADD config.json /app/config.json | |
COPY --from=build-env /app/app /app/app | |
WORKDIR /app | |
ENTRYPOINT [ "./app"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment