binary-daemon 745 B

123456789101112131415161718192021222324252627
  1. #!/usr/bin/env bash
  2. set -e
  3. copy_binaries() {
  4. local dir="$1"
  5. local hash="$2"
  6. # Add nested executables to bundle dir so we have complete set of
  7. # them available, but only if the native OS/ARCH is the same as the
  8. # OS/ARCH of the build target
  9. if [ "$(go env GOOS)/$(go env GOARCH)" != "$(go env GOHOSTOS)/$(go env GOHOSTARCH)" ]; then
  10. return
  11. fi
  12. if [ ! -x /usr/local/bin/docker-runc ]; then
  13. return
  14. fi
  15. echo "Copying nested executables into $dir"
  16. for file in containerd containerd-shim containerd-ctr runc init proxy; do
  17. cp -f `which "docker-$file"` "$dir/"
  18. if [ "$hash" == "hash" ]; then
  19. hash_files "$dir/docker-$file"
  20. fi
  21. done
  22. }
  23. [ -z "$KEEPDEST" ] && rm -rf "$DEST"
  24. source "${MAKEDIR}/.binary"
  25. copy_binaries "$DEST" 'hash'