2018-02-16 13:51:30 -05:00
|
|
|
#!/bin/sh
|
2021-08-23 04:16:11 -04:00
|
|
|
set -e
|
2018-02-16 13:51:30 -05:00
|
|
|
|
2021-07-26 08:48:52 -04:00
|
|
|
# RUNC_VERSION specifies the version of runc to install from the
|
|
|
|
# https://github.com/opencontainers/runc repository.
|
|
|
|
#
|
2018-11-16 08:31:57 -05:00
|
|
|
# The version of runc should match the version that is used by the containerd
|
|
|
|
# version that is used. If you need to update runc, open a pull request in
|
|
|
|
# the containerd project first, and update both after that is merged.
|
2021-07-26 08:48:52 -04:00
|
|
|
#
|
2021-12-15 14:35:04 -05:00
|
|
|
# When updating RUNC_VERSION, consider updating runc in vendor.mod accordingly
|
2022-04-01 02:24:13 -04:00
|
|
|
: "${RUNC_VERSION:=v1.1.1}"
|
2018-02-16 13:51:30 -05:00
|
|
|
|
|
|
|
install_runc() {
|
2021-08-23 04:16:11 -04:00
|
|
|
RUNC_BUILDTAGS="${RUNC_BUILDTAGS:-"seccomp"}"
|
2018-02-16 13:51:30 -05:00
|
|
|
|
2021-07-26 08:48:52 -04:00
|
|
|
echo "Install runc version $RUNC_VERSION (build tags: $RUNC_BUILDTAGS)"
|
2018-02-16 13:51:30 -05:00
|
|
|
git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc"
|
|
|
|
cd "$GOPATH/src/github.com/opencontainers/runc"
|
2021-07-26 08:48:52 -04:00
|
|
|
git checkout -q "$RUNC_VERSION"
|
2018-03-07 16:29:10 -05:00
|
|
|
if [ -z "$1" ]; then
|
|
|
|
target=static
|
|
|
|
else
|
|
|
|
target="$1"
|
|
|
|
fi
|
|
|
|
make BUILDTAGS="$RUNC_BUILDTAGS" "$target"
|
2018-12-22 14:18:33 -05:00
|
|
|
mkdir -p "${PREFIX}"
|
|
|
|
cp runc "${PREFIX}/runc"
|
2018-02-16 13:51:30 -05:00
|
|
|
}
|