Files
docker-cli/components/engine/hack/make/binary
Michael Hudson-Doyle 4602c3289a Use code generation to set IAMSTATIC instead of -X
Signed-off-by: Michael Hudson-Doyle <michael.hudson@linaro.org>
Upstream-commit: 3e10b93106dea94e5747ab32fe4ac765aa22f9bc
Component: engine
2014-10-24 10:56:51 +13:00

29 lines
470 B
Bash
Executable File

#!/bin/bash
set -e
DEST=$1
: ${IAMSTATIC:=true}
cat > dockerversion/static.go <<EOF
// AUTOGENERATED FILE; see hack/make/binary and hack/make/dynbinary
package dockerversion
func init() {
IAMSTATIC = $IAMSTATIC
}
EOF
go build \
-o "$DEST/docker-$VERSION" \
"${BUILDFLAGS[@]}" \
-ldflags "
$LDFLAGS
$LDFLAGS_STATIC_DOCKER
" \
./docker
echo "Created binary: $DEST/docker-$VERSION"
ln -sf "docker-$VERSION" "$DEST/docker"
hash_files "$DEST/docker-$VERSION"