2018-02-16 13:51:30 -05:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# When updating RUNC_COMMIT, also update runc in vendor.conf accordingly
|
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.
|
2018-12-06 20:55:37 -05:00
|
|
|
RUNC_COMMIT=96ec2177ae841256168fcf76954f7177af9446eb
|
2018-02-16 13:51:30 -05:00
|
|
|
|
|
|
|
install_runc() {
|
2018-11-06 14:15:36 -05:00
|
|
|
# If using RHEL7 kernels (3.10.0 el7), disable kmem accounting/limiting
|
|
|
|
if uname -r | grep -q '^3\.10\.0.*\.el7\.'; then
|
|
|
|
: ${RUNC_NOKMEM='nokmem'}
|
|
|
|
fi
|
|
|
|
|
2018-02-16 13:51:30 -05:00
|
|
|
# Do not build with ambient capabilities support
|
2018-11-06 14:15:36 -05:00
|
|
|
RUNC_BUILDTAGS="${RUNC_BUILDTAGS:-"seccomp apparmor selinux $RUNC_NOKMEM"}"
|
2018-02-16 13:51:30 -05:00
|
|
|
|
2018-11-06 14:15:36 -05:00
|
|
|
echo "Install runc version $RUNC_COMMIT (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"
|
|
|
|
git checkout -q "$RUNC_COMMIT"
|
2018-03-07 16:29:10 -05:00
|
|
|
if [ -z "$1" ]; then
|
|
|
|
target=static
|
|
|
|
else
|
|
|
|
target="$1"
|
|
|
|
fi
|
|
|
|
make BUILDTAGS="$RUNC_BUILDTAGS" "$target"
|
2018-02-16 13:51:30 -05:00
|
|
|
mkdir -p ${PREFIX}
|
2018-09-21 18:58:34 -04:00
|
|
|
cp runc ${PREFIX}/runc
|
2018-02-16 13:51:30 -05:00
|
|
|
}
|