From a4d9985c381c672630a84076a7be8166d1b38b92 Mon Sep 17 00:00:00 2001 From: Kir Kolyshkin Date: Tue, 6 Nov 2018 11:15:36 -0800 Subject: [PATCH] runc.installer: add nokmem build tag for rhel7 kernel In case we're running on RHEL7 kernel, which has non-working and broken kernel memory controller, add 'nokmem' build tag so that runc never enables kmem accounting. For more info, see the following runc commit: https://github.com/opencontainers/runc/commit/6a2c1559684 This behavior can be overriden by having `RUNC_NOKMEM` environment variable set (e.g. to empty value to disable setting nokmem). Signed-off-by: Kir Kolyshkin (cherry picked from commit 8972aa9350d52e4a7e58242447b7a9d2f0c27f37) Signed-off-by: Sebastiaan van Stijn Upstream-commit: 8486ea11ae800a1e6d634b741dfb007ba29f6003 Component: engine --- .../engine/hack/dockerfile/install/runc.installer | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/components/engine/hack/dockerfile/install/runc.installer b/components/engine/hack/dockerfile/install/runc.installer index f10375a799..18723dc605 100755 --- a/components/engine/hack/dockerfile/install/runc.installer +++ b/components/engine/hack/dockerfile/install/runc.installer @@ -4,10 +4,15 @@ RUNC_COMMIT=9f1e94488e5e478e084fef997f022565b64b01d9 install_runc() { - # Do not build with ambient capabilities support - RUNC_BUILDTAGS="${RUNC_BUILDTAGS:-"seccomp apparmor selinux"}" + # 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 - echo "Install runc version $RUNC_COMMIT" + # Do not build with ambient capabilities support + RUNC_BUILDTAGS="${RUNC_BUILDTAGS:-"seccomp apparmor selinux $RUNC_NOKMEM"}" + + echo "Install runc version $RUNC_COMMIT (build tags: $RUNC_BUILDTAGS)" 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"