2018-02-16 18:51:30 +00:00
|
|
|
#!/bin/sh
|
2021-08-23 08:16:11 +00:00
|
|
|
set -e
|
2018-02-16 18:51:30 +00:00
|
|
|
|
2021-07-26 12:48:52 +00:00
|
|
|
# RUNC_VERSION specifies the version of runc to install from the
|
|
|
|
# https://github.com/opencontainers/runc repository.
|
|
|
|
#
|
2018-11-16 13:31:57 +00: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 12:48:52 +00:00
|
|
|
#
|
2021-12-15 19:35:04 +00:00
|
|
|
# When updating RUNC_VERSION, consider updating runc in vendor.mod accordingly
|
2023-11-13 15:01:02 +00:00
|
|
|
: "${RUNC_VERSION:=v1.1.10}"
|
2018-02-16 18:51:30 +00:00
|
|
|
|
|
|
|
install_runc() {
|
2021-08-23 08:16:11 +00:00
|
|
|
RUNC_BUILDTAGS="${RUNC_BUILDTAGS:-"seccomp"}"
|
2018-02-16 18:51:30 +00:00
|
|
|
|
2021-07-26 12:48:52 +00:00
|
|
|
echo "Install runc version $RUNC_VERSION (build tags: $RUNC_BUILDTAGS)"
|
2018-02-16 18:51:30 +00: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 12:48:52 +00:00
|
|
|
git checkout -q "$RUNC_VERSION"
|
2018-03-07 21:29:10 +00:00
|
|
|
if [ -z "$1" ]; then
|
|
|
|
target=static
|
|
|
|
else
|
|
|
|
target="$1"
|
|
|
|
fi
|
|
|
|
make BUILDTAGS="$RUNC_BUILDTAGS" "$target"
|
2018-12-22 19:18:33 +00:00
|
|
|
mkdir -p "${PREFIX}"
|
|
|
|
cp runc "${PREFIX}/runc"
|
2018-02-16 18:51:30 +00:00
|
|
|
}
|