binary-daemon 980 B

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