binary-daemon 1.0 KB

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 might not be available for the target platform, see vpnkit stage in
  19. # the Dockerfile for more information.
  20. if command -v vpnkit > /dev/null 2>&1; then
  21. cp -f "$(command -v vpnkit)" "$dir/"
  22. fi
  23. }
  24. [ -z "$KEEPDEST" ] && rm -rf "$DEST"
  25. (
  26. DOCKER_STATIC=1
  27. GO_PACKAGE='github.com/docker/docker/cmd/dockerd'
  28. BINARY_NAME='dockerd'
  29. source "${MAKEDIR}/.binary"
  30. copy_binaries "$DEST"
  31. )