Created
July 20, 2019 19:08
-
-
Save tom-code/b53df058ef05819566893b9577bc3742 to your computer and use it in GitHub Desktop.
static go linking
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
| CGO_ENABLED=0 GOOS=linux go build -a -ldflags '-extldflags "-static"' . | |
| -ldflags '-extldflags "-fno-PIC -static"' -buildmode pie -tags 'osusergo netgo static_build' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment