summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJohn Estabrook <jestabro@vyos.io>2026-08-27 09:37:57 -0500
committerGitHub <noreply@github.com>2026-08-27 09:37:57 -0500
commitb7e9483971e1f0165dbe05b81524912c8e1aaa65 (patch)
tree3d1ec9d4ddf444d747ce5ba11939359164484ccb /src
parente956c125a2d9669ea5163bcc80206ab27ce88ee3 (diff)
parent61068a77bcea9e2dd6cec316b0bdba09f096affa (diff)
downloadvyos-1x-b7e9483971e1f0165dbe05b81524912c8e1aaa65.tar.gz
vyos-1x-b7e9483971e1f0165dbe05b81524912c8e1aaa65.zip
Merge pull request #5423 from indrajitr/container-cgroupns
T9240: container: Allow sharing host's cgroup namespace with container
Diffstat (limited to 'src')
-rw-r--r--[-rwxr-xr-x]src/conf_mode/container.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/conf_mode/container.py b/src/conf_mode/container.py
index 15bec36ec..764c26d84 100755..100644
--- a/src/conf_mode/container.py
+++ b/src/conf_mode/container.py
@@ -475,6 +475,10 @@ def generate_run_arguments(name, container_config, host_ident, network_config):
if 'allow_host_pid' in container_config:
host_pid = '--pid host'
+ cgroupns = ''
+ if 'allow_host_cgroups' in container_config:
+ cgroupns = '--cgroupns host'
+
name_server = []
if 'name_server' in container_config:
for ns in container_config['name_server']:
@@ -486,7 +490,7 @@ def generate_run_arguments(name, container_config, host_ident, network_config):
container_base_cmd = f'--detach --interactive --tty --replace {capabilities} {privileged} --cpus {cpu_quota} {sysctl_opt} ' \
f'--memory {memory}m --shm-size {shared_memory}m --memory-swap 0 --restart {restart} --log-driver={log_driver} ' \
- f'--name {name} {hostname} {device} {port} {name_server} {volume} {tmpfs} {env_opt} {label} {uid} {host_pid}'
+ f'--name {name} {hostname} {device} {port} {name_server} {volume} {tmpfs} {env_opt} {label} {uid} {host_pid} {cgroupns}'
entrypoint = ''
if 'entrypoint' in container_config: