Fix dynbinary so that dockerinit can still be properly static even if it has to link against libapparmor for Ubuntu
Docker-DCO-1.1-Signed-off-by: Andrew Page <admwiggin@gmail.com> (github: tianon) Upstream-commit: be344cf0d8e4f9881724f49398603a6e3109bc89 Component: engine
This commit is contained in:
@ -3,7 +3,15 @@
|
||||
DEST=$1
|
||||
|
||||
# dockerinit still needs to be a static binary, even if docker is dynamic
|
||||
CGO_ENABLED=0 go build -o $DEST/dockerinit-$VERSION -ldflags "$LDFLAGS -d" "${BUILDFLAGS[@]}" ./dockerinit
|
||||
go build \
|
||||
-o $DEST/dockerinit-$VERSION \
|
||||
"${BUILDFLAGS[@]}" \
|
||||
-ldflags "
|
||||
$LDFLAGS
|
||||
$LDFLAGS_STATIC
|
||||
-extldflags \"$EXTLDFLAGS_STATIC\"
|
||||
" \
|
||||
./dockerinit
|
||||
echo "Created binary: $DEST/dockerinit-$VERSION"
|
||||
ln -sf dockerinit-$VERSION $DEST/dockerinit
|
||||
|
||||
@ -23,6 +31,6 @@ export DOCKER_INITSHA1="$($sha1sum $DEST/dockerinit-$VERSION | cut -d' ' -f1)"
|
||||
# exported so that "dyntest" can easily access it later without recalculating it
|
||||
|
||||
(
|
||||
export LDFLAGS_STATIC="-X github.com/dotcloud/docker/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" -X github.com/dotcloud/docker/dockerversion.INITPATH \"$DOCKER_INITPATH\""
|
||||
export LDFLAGS_STATIC_DOCKER="-X github.com/dotcloud/docker/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" -X github.com/dotcloud/docker/dockerversion.INITPATH \"$DOCKER_INITPATH\""
|
||||
source "$(dirname "$BASH_SOURCE")/binary"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user