build-target 729 B

123456789101112131415161718192021
  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}"
  13. go build -tags "selinux cgo daemon netgo" -installsuffix netgo -ldflags "$CONST -linkmode external -extldflags -static" -o ${OUTPUT}
  14. strip --strip-all ${OUTPUT}