Skip to content

Instantly share code, notes, and snippets.

@raphink
Created April 8, 2016 11:09
Show Gist options
  • Select an option

  • Save raphink/312ccdb9518d9a861b5988054c85a45f to your computer and use it in GitHub Desktop.

Select an option

Save raphink/312ccdb9518d9a861b5988054c85a45f to your computer and use it in GitHub Desktop.
Minimal docker image for go binary
$ CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -o app .
$ strip app
$ docker build .
FROM scratch
ADD app /
CMD ["/app"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment