2018-10-15 03:52:53 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2020-04-27 00:02:30 -04:00
|
|
|
# v0.9.4
|
|
|
|
: ${ROOTLESSKIT_COMMIT:=0fec9adac6b078aa8616da47e9d75f663ca3f492}
|
2018-10-15 03:52:53 -04:00
|
|
|
|
|
|
|
install_rootlesskit() {
|
|
|
|
case "$1" in
|
2020-03-02 22:27:49 -05:00
|
|
|
"dynamic")
|
|
|
|
install_rootlesskit_dynamic
|
|
|
|
return
|
|
|
|
;;
|
|
|
|
"")
|
|
|
|
export CGO_ENABLED=0
|
|
|
|
_install_rootlesskit
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo 'Usage: $0 [dynamic]'
|
|
|
|
;;
|
2018-10-15 03:52:53 -04:00
|
|
|
esac
|
|
|
|
}
|
|
|
|
|
|
|
|
install_rootlesskit_dynamic() {
|
|
|
|
export ROOTLESSKIT_LDFLAGS="-linkmode=external" install_rootlesskit
|
|
|
|
export BUILD_MODE="-buildmode=pie"
|
|
|
|
_install_rootlesskit
|
|
|
|
}
|
|
|
|
|
|
|
|
_install_rootlesskit() {
|
|
|
|
echo "Install rootlesskit version $ROOTLESSKIT_COMMIT"
|
|
|
|
git clone https://github.com/rootless-containers/rootlesskit.git "$GOPATH/src/github.com/rootless-containers/rootlesskit"
|
|
|
|
cd "$GOPATH/src/github.com/rootless-containers/rootlesskit"
|
|
|
|
git checkout -q "$ROOTLESSKIT_COMMIT"
|
2019-03-20 13:11:31 -04:00
|
|
|
for f in rootlesskit rootlesskit-docker-proxy; do
|
|
|
|
go build $BUILD_MODE -ldflags="$ROOTLESSKIT_LDFLAGS" -o "${PREFIX}/$f" github.com/rootless-containers/rootlesskit/cmd/$f
|
|
|
|
done
|
2018-10-15 03:52:53 -04:00
|
|
|
}
|