DEV Community

Discussion on: Slim Docker images for your Go application

Collapse
 
maxatome profile image
Maxime Soulé

Add -ldflags '-s -w' to go build to strip DWARF, symbol table and debug info. Expect ~25% binary size decrease.

golang.org/cmd/link/