Created
May 2, 2015 21:20
-
-
Save ddgenome/3b4eee49013e68552bc4 to your computer and use it in GitHub Desktop.
Compile Go program into a static binary
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
# Go 1.4 | |
CGO_ENABLED=0 GOOS=linux go get -a -installsuffix cgo -ldflags '-s' github.com/elastic/logstash-forwarder | |
# Go 1.3 | |
CGO_ENABLED=0 GOOS=linux go get -a -ldflags '-s' github.com/elastic/logstash-forwarder | |
# GOOS is the OS target of the binary | |
# -a forces recompilation of all components | |
# you can replace get with build and the GitHub URL with a path to the directory with the code | |
# the -s ld option strips the symbols from the binary making it smaller |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment