
https://github.com/rootless-containers/rootlesskit/issues/41 Signed-off-by: Akihiro Suda <suda.akihiro@lab.ntt.co.jp>
34 lines
894 B
Bash
Executable file
34 lines
894 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# v0.3.0-alpha.1
|
|
ROOTLESSKIT_COMMIT=7905ee34b3d9d1f27fe2ffa3c5fd3d01bb3644dd
|
|
|
|
install_rootlesskit() {
|
|
case "$1" in
|
|
"dynamic")
|
|
install_rootlesskit_dynamic
|
|
return
|
|
;;
|
|
"")
|
|
export CGO_ENABLED=0
|
|
_install_rootlesskit
|
|
;;
|
|
*)
|
|
echo 'Usage: $0 [dynamic]'
|
|
;;
|
|
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"
|
|
go build $BUILD_MODE -ldflags="$ROOTLESSKIT_LDFLAGS" -o "${PREFIX}/rootlesskit" github.com/rootless-containers/rootlesskit/cmd/rootlesskit
|
|
}
|