Procházet zdrojové kódy

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 <kolyshkin@gmail.com>
Kir Kolyshkin před 6 roky
rodič
revize
8972aa9350
1 změnil soubory, kde provedl 7 přidání a 2 odebrání
  1. 7 2
      hack/dockerfile/install/runc.installer

+ 7 - 2
hack/dockerfile/install/runc.installer

@@ -4,10 +4,15 @@
 RUNC_COMMIT=9f1e94488e5e478e084fef997f022565b64b01d9
 RUNC_COMMIT=9f1e94488e5e478e084fef997f022565b64b01d9
 
 
 install_runc() {
 install_runc() {
+	# 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
+
 	# Do not build with ambient capabilities support
 	# Do not build with ambient capabilities support
-	RUNC_BUILDTAGS="${RUNC_BUILDTAGS:-"seccomp apparmor selinux"}"
+	RUNC_BUILDTAGS="${RUNC_BUILDTAGS:-"seccomp apparmor selinux $RUNC_NOKMEM"}"
 
 
-	echo "Install runc version $RUNC_COMMIT"
+	echo "Install runc version $RUNC_COMMIT (build tags: $RUNC_BUILDTAGS)"
 	git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc"
 	git clone https://github.com/opencontainers/runc.git "$GOPATH/src/github.com/opencontainers/runc"
 	cd "$GOPATH/src/github.com/opencontainers/runc"
 	cd "$GOPATH/src/github.com/opencontainers/runc"
 	git checkout -q "$RUNC_COMMIT"
 	git checkout -q "$RUNC_COMMIT"