containerd.installer 982 B

123456789101112131415161718192021222324252627282930313233343536
  1. #!/bin/sh
  2. # containerd is also pinned in vendor.conf. When updating the binary
  3. # version you may also need to update the vendor version to pick up bug
  4. # fixes or new APIs.
  5. CONTAINERD_COMMIT=aa5e000c963756778ab3ebd1a12c67449c503a34 # v1.2.1+
  6. install_containerd() {
  7. echo "Install containerd version $CONTAINERD_COMMIT"
  8. git clone https://github.com/containerd/containerd.git "$GOPATH/src/github.com/containerd/containerd"
  9. cd "$GOPATH/src/github.com/containerd/containerd"
  10. git checkout -q "$CONTAINERD_COMMIT"
  11. (
  12. export BUILDTAGS='netgo osusergo static_build'
  13. export EXTRA_FLAGS='-buildmode=pie'
  14. export EXTRA_LDFLAGS='-extldflags "-fno-PIC -static"'
  15. # Reset build flags to nothing if we want a dynbinary
  16. if [ "$1" == "dynamic" ]; then
  17. export BUILDTAGS=''
  18. export EXTRA_FLAGS=''
  19. export EXTRA_LDFLAGS=''
  20. fi
  21. make
  22. )
  23. mkdir -p ${PREFIX}
  24. cp bin/containerd ${PREFIX}/containerd
  25. cp bin/containerd-shim ${PREFIX}/containerd-shim
  26. cp bin/ctr ${PREFIX}/ctr
  27. }