Last active
November 13, 2025 00:46
-
-
Save rms1000watt/e6fcdadf26ae10c7df3b3e8a0dc4d7e9 to your computer and use it in GitHub Desktop.
Go Build command with netgo
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
| GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -tags netgo -installsuffix netgo -o bin/linux-golang-server | |
| GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -tags netgo -installsuffix netgo -ldflags '-w -extldflags "-static"' -o bin/linux-golang-server | |
| GOOS=linux GOARCH=amd64 CGO_ENABLED=0 go build -a -tags netgo -installsuffix netgo -ldflags '-w -extldflags=-static' -o bin/linux-golang-server |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
go build -tags netgo -ldflags '-s -w' -o app