1
0
mirror of https://github.com/rancher/os.git synced 2025-08-31 22:32:14 +00:00
Files
os/scripts/build-target

21 lines
789 B
Plaintext
Raw Normal View History

2016-05-06 10:12:09 -07:00
#!/bin/bash
set -e
ros="$1"
source $(dirname $0)/version
cd $(dirname $0)/..
if [ "${!TOOLCHAIN}" != "" ]; then
export CC=/usr/bin/${!TOOLCHAIN}-gcc
export CGO_ENABLED=1
fi
OUTPUT=${OUTPUT:-bin/ros}
echo Building $OUTPUT
2016-05-31 21:38:10 -07:00
CONST="-X github.com/docker/docker/dockerversion.GitCommit=${COMMIT} -X github.com/docker/docker/dockerversion.Version=${DOCKER_PATCH_VERSION} -X github.com/docker/docker/dockerversion.BuildTime=$(date -u +'%Y-%m-%dT%H:%M:%SZ') -X github.com/docker/docker/dockerversion.IAmStatic=true -X github.com/rancher/os/config.VERSION=${VERSION} -X github.com/rancher/os/config.OS_REPO=${OS_REPO}"
2016-06-27 20:05:19 -07:00
go build -tags "selinux cgo daemon netgo dnspatch" -installsuffix netgo -ldflags "$CONST -linkmode external -extldflags -static" -o ${OUTPUT}
2016-05-31 21:11:03 -07:00
strip --strip-all ${OUTPUT}