| 1 | #!/usr/bin/envscip-shell filesystem . . `/usr/bin/env`. bash |
| 2 | set -e |
| 3 | |
| 4 | copy_binariesscip-shell shell shell-project 0.0.0 copy_binaries().() { |
| 5 | local dir="${1:?}" |
| 6 | |
| 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 [scip-shell system . . `[`. "$(goscip-shell system . . go. env GOOS)/$(goscip-shell system . . go. env GOARCH)" != "$(goscip-shell system . . go. env GOHOSTOS)/$(goscip-shell system . . go. env GOHOSTARCH)" ]; then |
| 11 | return |
| 12 | fi |
| 13 | if [scip-shell system . . `[`. ! -x /usr/local/bin/runcscip-shell filesystem . . `/usr/local/bin/runc`. ]; then |
| 14 | return |
| 15 | fi |
| 16 | echoscip-shell system . . echo. "Copying nested executables into $dir" |
| 17 | for file in containerd containerd-shim-runc-v2 ctr runc docker-init rootlesskit dockerd-rootless.sh dockerd-rootless-setuptool.sh; do |
| 18 | cpscip-shell system . . cp. -f "$(command -v "$file")" "$dir/" |
| 19 | done |
| 20 | # vpnkit might not be available for the target platform, see vpnkit stage in |
| 21 | # the Dockerfile for more information. |
| 22 | if command -v vpnkit > /dev/nullscip-shell filesystem . . `/dev/null`. 2>&1; then |
| 23 | cpscip-shell system . . cp. -f "$(command -v vpnkit)" "$dir/" |
| 24 | fi |
| 25 | } |
| 26 | |
| 27 | [scip-shell system . . `[`. -z "$KEEPDEST" ] && rmscip-shell system . . rm. -rf "$DEST" |
| 28 | |
| 29 | ( |
| 30 | DOCKER_STATIC=1 |
| 31 | GO_PACKAGE='github.com/docker/docker/cmd/dockerd' |
| 32 | BINARY_NAME='dockerd' |
| 33 | source "${MAKEDIR}/.binary" |
| 34 | copy_binariesscip-shell shell shell-project 0.0.0 copy_binaries(). "$DEST" |
| 35 | ) |