github.com/demonoid81/moby@v0.0.0-20200517203328-62dd8e17c460/hack/dockerfile/install/rootlesskit.installer (about) 1 #!/bin/sh 2 3 # v0.9.5 4 : ${ROOTLESSKIT_COMMIT:=3f5728fbb2b6abdc63d59759e72735442ce6424e} 5 6 install_rootlesskit() { 7 case "$1" in 8 "dynamic") 9 install_rootlesskit_dynamic 10 return 11 ;; 12 "") 13 export CGO_ENABLED=0 14 _install_rootlesskit 15 ;; 16 *) 17 echo 'Usage: $0 [dynamic]' 18 ;; 19 esac 20 } 21 22 install_rootlesskit_dynamic() { 23 export ROOTLESSKIT_LDFLAGS="-linkmode=external" install_rootlesskit 24 export BUILD_MODE="-buildmode=pie" 25 _install_rootlesskit 26 } 27 28 _install_rootlesskit() { 29 echo "Install rootlesskit version $ROOTLESSKIT_COMMIT" 30 git clone https://github.com/rootless-containers/rootlesskit.git "$GOPATH/src/github.com/rootless-containers/rootlesskit" 31 cd "$GOPATH/src/github.com/rootless-containers/rootlesskit" 32 git checkout -q "$ROOTLESSKIT_COMMIT" 33 for f in rootlesskit rootlesskit-docker-proxy; do 34 go build $BUILD_MODE -ldflags="$ROOTLESSKIT_LDFLAGS" -o "${PREFIX}/$f" github.com/rootless-containers/rootlesskit/cmd/$f 35 done 36 }