Skip to content

Instantly share code, notes, and snippets.

@Aracki
Created October 2, 2018 09:22
Show Gist options
  • Save Aracki/c70c32d2da5807e3ef6dcb04c47388cc to your computer and use it in GitHub Desktop.
Save Aracki/c70c32d2da5807e3ef6dcb04c47388cc to your computer and use it in GitHub Desktop.
Countgo - Dockerfile with multi-stage build used to deploy GoLang app
FROM golang:1.10.3-alpine as builder
WORKDIR $GOPATH/src/github.com/aracki/countgo
COPY . .
ENV GOBIN $GOPATH/bin
RUN GOOS=linux GOARCH=386 go install cmd/aracki/main.go
FROM scratch as appgo
COPY --from=builder /go/bin/main /go/bin/main
COPY mongo_config.yml mongo_config.yml
ENTRYPOINT ["/go/bin/main"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment