2017-02-13 14:01:54 -05:00
#!/usr/bin/env bash
2016-02-19 17:42:51 -05:00
set -e
2017-07-05 15:38:23 -04:00
copy_binaries() {
local dir="$1"
2022-07-02 11:34:48 -04:00
2017-07-05 15:38:23 -04:00
# Add nested executables to bundle dir so we have complete set of
# them available, but only if the native OS/ARCH is the same as the
# OS/ARCH of the build target
2019-01-09 20:23:38 -05:00
if [ "$(go env GOOS)/$(go env GOARCH)" != "$(go env GOHOSTOS)/$(go env GOHOSTARCH)" ]; then
2017-07-05 15:38:23 -04:00
return
fi
2019-01-09 20:23:38 -05:00
if [ ! -x /usr/local/bin/runc ]; then
2017-07-05 15:38:23 -04:00
return
fi
echo "Copying nested executables into $dir"
2022-06-05 05:19:43 -04:00
for file in containerd containerd-shim-runc-v2 ctr runc docker-init rootlesskit rootlesskit-docker-proxy dockerd-rootless.sh dockerd-rootless-setuptool.sh; do
2019-08-31 06:12:25 -04:00
cp -f "$(command -v "$file")" "$dir/"
2017-07-05 15:38:23 -04:00
done
2019-02-05 21:11:18 -05:00
2021-02-24 00:05:38 -05:00
# vpnkit is available for x86_64 and aarch64
2020-03-02 22:27:49 -05:00
if command -v "vpnkit.$(uname -m)" 2>&1 > /dev/null; then
2019-08-31 06:12:25 -04:00
cp -f "$(command -v "vpnkit.$(uname -m)")" "$dir/vpnkit"
2019-02-05 21:11:18 -05:00
fi
2017-07-05 15:38:23 -04:00
}
2016-05-23 21:44:43 -04:00
2019-01-09 20:23:38 -05:00
[ -z "$KEEPDEST" ] && rm -rf "$DEST"
2021-04-06 19:32:46 -04:00
(
GO_PACKAGE='github.com/docker/docker/cmd/dockerd'
2022-07-02 10:57:51 -04:00
BINARY_NAME='dockerd'
2021-04-06 19:32:46 -04:00
source "${MAKEDIR}/.binary"
2022-07-02 11:34:48 -04:00
copy_binaries "$DEST"
2021-04-06 19:32:46 -04:00
)