|
@@ -5,6 +5,14 @@ DEST=$1
|
|
|
|
|
|
if [ -z "$DOCKER_CLIENTONLY" ]; then
|
|
if [ -z "$DOCKER_CLIENTONLY" ]; then
|
|
# dockerinit still needs to be a static binary, even if docker is dynamic
|
|
# dockerinit still needs to be a static binary, even if docker is dynamic
|
|
|
|
+ cat > dockerversion/static.go <<EOF
|
|
|
|
+// AUTOGENERATED FILE; see hack/make/binary and hack/make/dynbinary
|
|
|
|
+package dockerversion
|
|
|
|
+
|
|
|
|
+func init() {
|
|
|
|
+ IAMSTATIC = true
|
|
|
|
+}
|
|
|
|
+EOF
|
|
go build \
|
|
go build \
|
|
-o "$DEST/dockerinit-$VERSION" \
|
|
-o "$DEST/dockerinit-$VERSION" \
|
|
"${BUILDFLAGS[@]}" \
|
|
"${BUILDFLAGS[@]}" \
|
|
@@ -40,6 +48,7 @@ fi
|
|
|
|
|
|
(
|
|
(
|
|
export LDFLAGS_STATIC_DOCKER="-X $DOCKER_PKG/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" -X $DOCKER_PKG/dockerversion.INITPATH \"$DOCKER_INITPATH\""
|
|
export LDFLAGS_STATIC_DOCKER="-X $DOCKER_PKG/dockerversion.INITSHA1 \"$DOCKER_INITSHA1\" -X $DOCKER_PKG/dockerversion.INITPATH \"$DOCKER_INITPATH\""
|
|
|
|
+ export IAMSTATIC=false
|
|
export BUILDFLAGS=( "${BUILDFLAGS[@]/netgo /}" ) # disable netgo, since we don't need it for a dynamic binary
|
|
export BUILDFLAGS=( "${BUILDFLAGS[@]/netgo /}" ) # disable netgo, since we don't need it for a dynamic binary
|
|
source "$(dirname "$BASH_SOURCE")/binary"
|
|
source "$(dirname "$BASH_SOURCE")/binary"
|
|
)
|
|
)
|