build-target 766 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. set -e
  3. ros="$1"
  4. source $(dirname $0)/version
  5. cd $(dirname $0)/..
  6. if [ "${!TOOLCHAIN}" != "" ]; then
  7. export CC=/usr/bin/${!TOOLCHAIN}-gcc
  8. export CGO_ENABLED=1
  9. fi
  10. OUTPUT=${OUTPUT:-bin/ros}
  11. echo Building $OUTPUT
  12. 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.OsRepo=${OS_REPO}"
  13. go build -tags "selinux cgo daemon netgo dnspatch" -installsuffix netgo -ldflags "$CONST -linkmode external -extldflags -static -s -w" -o ${OUTPUT}