Skip to content

Instantly share code, notes, and snippets.

@biancarosa
Created April 19, 2018 00:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save biancarosa/c08c603fc9d55e2408a09aea4695e96b to your computer and use it in GitHub Desktop.
Save biancarosa/c08c603fc9d55e2408a09aea4695e96b to your computer and use it in GitHub Desktop.
simple-and-small-go-dockerfile
FROM golang:latest AS build
WORKDIR $GOPATH/{your-repo}
COPY . ./
RUN go get github.com/tools/godep
RUN godep get
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix nocgo -o /app .
FROM scratch
COPY --from=build /app ./
ENTRYPOINT ["./app"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment