2018-10-15 03:52:53 -04:00
|
|
|
#!/bin/sh
|
|
|
|
|
2021-11-08 02:10:56 -05:00
|
|
|
: "${ROOTLESSKIT_VERSION:=v0.14.6}"
|
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
|
2020-05-20 21:23:00 -04:00
|
|
|
export BUILD_MODE=${GO_BUILDMODE}
|
2018-10-15 03:52:53 -04:00
|
|
|
_install_rootlesskit
|
|
|
|
}
|
|
|
|
|
2021-02-11 08:45:34 -05:00
|
|
|
_install_rootlesskit() (
|
2021-07-26 08:48:52 -04:00
|
|
|
echo "Install rootlesskit version ${ROOTLESSKIT_VERSION}"
|
2019-03-20 13:11:31 -04:00
|
|
|
for f in rootlesskit rootlesskit-docker-proxy; do
|
2021-07-26 08:48:52 -04:00
|
|
|
GOBIN="${PREFIX}" GO111MODULE=on go install ${BUILD_MODE} -ldflags="$ROOTLESSKIT_LDFLAGS" "github.com/rootless-containers/rootlesskit/cmd/${f}@${ROOTLESSKIT_VERSION}"
|
2019-03-20 13:11:31 -04:00
|
|
|
done
|
2021-02-11 08:45:34 -05:00
|
|
|
)
|