github.com/jwhonce/docker@v0.6.7-0.20190327063223-da823cf3a5a3/hack/make/binary-daemon (about)

     1  #!/usr/bin/env bash
     2  set -e
     3  
     4  copy_binaries() {
     5  	local dir="$1"
     6  	local hash="$2"
     7  	# Add nested executables to bundle dir so we have complete set of
     8  	# them available, but only if the native OS/ARCH is the same as the
     9  	# OS/ARCH of the build target
    10  	if [ "$(go env GOOS)/$(go env GOARCH)" != "$(go env GOHOSTOS)/$(go env GOHOSTARCH)" ]; then
    11  		return
    12  	fi
    13  	if [ ! -x /usr/local/bin/runc ]; then
    14  		return
    15  	fi
    16  	echo "Copying nested executables into $dir"
    17  	for file in containerd containerd-shim ctr runc docker-init docker-proxy rootlesskit dockerd-rootless.sh; do
    18  		cp -f `which "$file"` "$dir/"
    19  		if [ "$hash" == "hash" ]; then
    20  			hash_files "$dir/$file"
    21  		fi
    22  	done
    23  
    24  	# vpnkit is amd64 only
    25  	if which "vpnkit.$(uname -m)" 2>&1 >/dev/null; then
    26  		cp -f `which "vpnkit.$(uname -m)"` "$dir/vpnkit"
    27  		if [ "$hash" == "hash" ]; then
    28  			hash_files "$dir/vpnkit"
    29  		fi
    30  	fi
    31  }
    32  
    33  [ -z "$KEEPDEST" ] && rm -rf "$DEST"
    34  source "${MAKEDIR}/.binary"
    35  copy_binaries "$DEST" 'hash'