...

Text file src/github.com/docker/cli/scripts/build/binary

Documentation: github.com/docker/cli/scripts/build

     1#!/usr/bin/env sh
     2#
     3# Build a static binary for the host OS/ARCH
     4#
     5
     6set -eu
     7
     8. ./scripts/build/.variables
     9
    10if [ "$CGO_ENABLED" = "1" ] && [ "$(go env GOOS)" != "windows" ]; then
    11  GO_BUILDTAGS="$GO_BUILDTAGS pkcs11"
    12fi
    13
    14echo "Building $GO_LINKMODE $(basename "${TARGET}")"
    15
    16export GO111MODULE=auto
    17
    18if [ "$(go env GOOS)" = "windows" ]; then
    19  if [ ! -x "$(command -v goversioninfo)" ]; then
    20    >&2 echo "goversioninfo not found, skipping manifesting binary"
    21  else
    22    ./scripts/build/mkversioninfo
    23    (set -x ; go generate -v "${SOURCE}")
    24  fi
    25fi
    26
    27(set -x ; go build -o "${TARGET}" -tags "${GO_BUILDTAGS}" -ldflags "${GO_LDFLAGS}" ${GO_BUILDMODE} "${SOURCE}")
    28
    29ln -sf "$(basename "${TARGET}")" "$(dirname "${TARGET}")/docker"

View as plain text