From 0df8838d154f2a1f38d0703ffa61b6802ea0d572 Mon Sep 17 00:00:00 2001 From: tpetr Date: Tue, 17 Oct 2017 10:58:39 -0400 Subject: [PATCH] allow setting --cgroup-parent for docker run commands --- build/common.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/build/common.sh b/build/common.sh index 242848e8ab5..6e0027dfb59 100755 --- a/build/common.sh +++ b/build/common.sh @@ -589,6 +589,11 @@ function kube::build::run_build_command_ex() { --env "GOGCFLAGS=${GOGCFLAGS:-}" ) + if [ ! -z "${DOCKER_CGROUP_PARENT:-}" ]; then + kube::log::status "Using ${DOCKER_CGROUP_PARENT} as container cgroup parent" + docker_run_opts+=(--cgroup-parent "${DOCKER_CGROUP_PARENT}") + fi + # If we have stdin we can run interactive. This allows things like 'shell.sh' # to work. However, if we run this way and don't have stdin, then it ends up # running in a daemon-ish mode. So if we don't have a stdin, we explicitly