github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/hack/make/install-binary (about)

     1  #!/usr/bin/env bash
     2  
     3  set -e
     4  rm -rf "$DEST"
     5  
     6  install_binary() {
     7  	local file="$1"
     8  	local target="${DOCKER_MAKE_INSTALL_PREFIX:=/usr/local}/bin/"
     9  	if [ "$(go env GOOS)" == "linux" ]; then
    10  		echo "Installing $(basename $file) to ${target}"
    11  		mkdir -p "$target"
    12  		cp -f -L "$file" "$target"
    13  	else
    14  		echo "Install is only supported on linux"
    15  		return 1
    16  	fi
    17  }
    18  
    19  (
    20  	DEST="$(dirname $DEST)/binary-daemon"
    21  	source "${MAKEDIR}/.binary-setup"
    22  	install_binary "${DEST}/${DOCKER_DAEMON_BINARY_NAME}"
    23  	install_binary "${DEST}/${DOCKER_RUNC_BINARY_NAME}"
    24  	install_binary "${DEST}/${DOCKER_CONTAINERD_BINARY_NAME}"
    25  	install_binary "${DEST}/${DOCKER_CONTAINERD_CTR_BINARY_NAME}"
    26  	install_binary "${DEST}/${DOCKER_CONTAINERD_SHIM_BINARY_NAME}"
    27  	install_binary "${DEST}/${DOCKER_PROXY_BINARY_NAME}"
    28  	install_binary "${DEST}/${DOCKER_INIT_BINARY_NAME}"
    29  	install_binary "${DEST}/${DOCKER_ROOTLESSKIT_BINARY_NAME}"
    30  	install_binary "${DEST}/${DOCKER_ROOTLESSKIT_DOCKER_PROXY_BINARY_NAME}"
    31  	install_binary "${DEST}/${DOCKER_DAEMON_ROOTLESS_SH_BINARY_NAME}"
    32  	if [ -f "${DEST}/${DOCKER_VPNKIT_BINARY_NAME}" ]; then
    33  		install_binary "${DEST}/${DOCKER_VPNKIT_BINARY_NAME}"
    34  	fi
    35  )