mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-06 13:41:36 +00:00
Use code generation to set IAMSTATIC instead of -X
Signed-off-by: Michael Hudson-Doyle <michael.hudson@linaro.org>
This commit is contained in:
@@ -5,6 +5,14 @@ DEST=$1
|
||||
|
||||
if [ -z "$DOCKER_CLIENTONLY" ]; then
|
||||
# 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 \
|
||||
-o "$DEST/dockerinit-$VERSION" \
|
||||
"${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 IAMSTATIC=false
|
||||
export BUILDFLAGS=( "${BUILDFLAGS[@]/netgo /}" ) # disable netgo, since we don't need it for a dynamic binary
|
||||
source "$(dirname "$BASH_SOURCE")/binary"
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user