install-binaries.sh 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #!/bin/sh
  2. set -e
  3. set -x
  4. TOMLV_COMMIT=9baf8a8a9f2ed20a8e54160840c492f937eeaf9a
  5. RUNC_COMMIT=cc29e3dded8e27ba8f65738f40d251c885030a28
  6. CONTAINERD_COMMIT=2545227b0357eb55e369fa0072baef9ad91cdb69
  7. GRIMES_COMMIT=f207601a8d19a534cc90d9e26e037e9931ccb9db
  8. export GOPATH="$(mktemp -d)"
  9. for prog in "$@"
  10. do
  11. case $prog in
  12. tomlv)
  13. echo "Install tomlv version $TOMLV_COMMIT"
  14. git clone https://github.com/BurntSushi/toml.git "$GOPATH/src/github.com/BurntSushi/toml"
  15. cd "$GOPATH/src/github.com/BurntSushi/toml" && git checkout -q "$TOMLV_COMMIT"
  16. go build -v -o /usr/local/bin/tomlv github.com/BurntSushi/toml/cmd/tomlv
  17. ;;
  18. runc)
  19. echo "Install runc version $RUNC_COMMIT"
  20. git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc"
  21. cd "$GOPATH/src/github.com/opencontainers/runc"
  22. git checkout -q "$RUNC_COMMIT"
  23. make static BUILDTAGS="seccomp apparmor selinux"
  24. cp runc /usr/local/bin/docker-runc
  25. ;;
  26. containerd)
  27. echo "Install containerd version $CONTAINERD_COMMIT"
  28. git clone https://github.com/docker/containerd.git "$GOPATH/src/github.com/docker/containerd"
  29. cd "$GOPATH/src/github.com/docker/containerd"
  30. git checkout -q "$CONTAINERD_COMMIT"
  31. make static
  32. cp bin/containerd /usr/local/bin/docker-containerd
  33. cp bin/containerd-shim /usr/local/bin/docker-containerd-shim
  34. cp bin/ctr /usr/local/bin/docker-containerd-ctr
  35. ;;
  36. grimes)
  37. echo "Install grimes version $GRIMES_COMMIT"
  38. git clone https://github.com/crosbymichael/grimes.git "$GOPATH/grimes"
  39. cd "$GOPATH/grimes"
  40. git checkout -q "$GRIMES_COMMIT"
  41. make
  42. cp init /usr/local/bin/docker-init
  43. ;;
  44. *)
  45. echo echo "Usage: $0 [tomlv|runc|containerd|grimes]"
  46. exit 1
  47. esac
  48. done
  49. rm -rf "$GOPATH"