Skip to content

Instantly share code, notes, and snippets.

@airtonGit
Created May 18, 2020 19:39
Show Gist options
  • Save airtonGit/3952a6e2d3fc08197846cd3e5e3c63ee to your computer and use it in GitHub Desktop.
Save airtonGit/3952a6e2d3fc08197846cd3e5e3c63ee to your computer and use it in GitHub Desktop.
Exemplo de Dockerfile para gerar imagem de microserviço em GO
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