Created
November 26, 2018 12:59
-
-
Save mtigdemir/1f79e28f6b9d26914546362707b7ca56 to your computer and use it in GitHub Desktop.
Go Build on Docker
This file contains hidden or 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
# Why did you have to build the binary with such an ugly command line? | |
# You have to explicitly make the binary static. | |
# This is really important in the Docker community right now because alpine has a different implementation of libc. | |
# So your go binary wouldn't have had the lib it needed if it wasn't static. | |
# You created a static binary so that your application could be self-contained. | |
go build --tags netgo --ldflags '-extldflags "-lm -lstdc++ -static"' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment