github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/hack/dockerfile/install/containerd.installer (about)

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