github.com/rita33cool1/iot-system-gateway@v0.0.0-20200911033302-e65bde238cc5/docker-engine/hack/dockerfile/install/containerd.installer (about)

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