3 ms·
Setting CGO_ENABLED=0 does not make the build fully static. To do this you currently need to set the following flags: -ldflags '-extldflags "-fno-PIC -stat
by zegl 7y ago
Setting CGO_ENABLED=0 does not make the build fully static. To do this you currently need to set the following flags:
-ldflags '-extldflags "-fno-PIC -static"' -buildmode pie -tags 'osusergo netgo static_build'
See https://github.com/golang/go/issues/26492 https://github.com/golang/go/issues/26492