Skip to content

Instantly share code, notes, and snippets.

@farhany
Created July 12, 2019 19:06
Show Gist options
  • Save farhany/6097b937749124d94f1545aed9cbf236 to your computer and use it in GitHub Desktop.
Save farhany/6097b937749124d94f1545aed9cbf236 to your computer and use it in GitHub Desktop.
static build with musl (alpine) for go
CC=$(which musl-gcc) go build --ldflags '-w -linkmode external -extldflags "-static"' server.go
// Source: https://www.reddit.com/r/golang/comments/4cxrcv/whats_the_proper_way_to_build_golang_apps_for/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment