mirror of https://github.com/docker/cli.git
Merge pull request #3490 from thaJeztah/fix_osusergo
scripts/build: make sure osusergo is set for static with CGO enabled
This commit is contained in:
commit
0b266ba0d8
|
@ -73,6 +73,10 @@ fi
|
|||
if [ "$CGO_ENABLED" = "1" ] && [ "$GO_LINKMODE" = "static" ] && [ "$(go env GOOS)" = "linux" ]; then
|
||||
LDFLAGS="$LDFLAGS -extldflags -static"
|
||||
fi
|
||||
if [ "$CGO_ENABLED" = "1" ] && [ "$GO_LINKMODE" = "static" ]; then
|
||||
# compiling statically with CGO enabled requires osusergo to be set.
|
||||
GO_BUILDTAGS="$GO_BUILDTAGS osusergo"
|
||||
fi
|
||||
if [ -n "$GO_STRIP" ]; then
|
||||
LDFLAGS="$LDFLAGS -s"
|
||||
fi
|
||||
|
|
Loading…
Reference in New Issue