Created
October 9, 2017 12:16
-
-
Save mostafa-asg/ca5641df7a4b29e4e07dec36324772a3 to your computer and use it in GitHub Desktop.
Building Minimal Docker Containers for Go Applications - source:(https://blog.codeship.com/building-minimal-docker-containers-for-go-applications/)
This file contains 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
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o main . |
This file contains 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 scratch | |
ADD /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ | |
ADD main / | |
CMD ["/main"] |
This file contains 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 scratch | |
ADD main / | |
CMD ["/main"] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment