From 3f83be294b4a47f09658ac43314421ee6223a9aa Mon Sep 17 00:00:00 2001 From: Nicolas Vollmar Date: Fri, 17 May 2024 08:59:55 +0200 Subject: T6358: Add config option for host process namespace (cherry picked from commit f5051de4fc034bd95677ef142423e59eae47cd2f) --- src/conf_mode/container.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/conf_mode/container.py') diff --git a/src/conf_mode/container.py b/src/conf_mode/container.py index c3b661ac5..91a10e891 100755 --- a/src/conf_mode/container.py +++ b/src/conf_mode/container.py @@ -329,9 +329,13 @@ def generate_run_arguments(name, container_config): prop = vol_config['propagation'] volume += f' --volume {svol}:{dvol}:{mode},{prop}' + host_pid = '' + if 'allow_host_pid' in container_config: + host_pid = '--pid host' + container_base_cmd = f'--detach --interactive --tty --replace {capabilities} ' \ f'--memory {memory}m --shm-size {shared_memory}m --memory-swap 0 --restart {restart} ' \ - f'--name {name} {hostname} {device} {port} {volume} {env_opt} {label} {uid}' + f'--name {name} {hostname} {device} {port} {volume} {env_opt} {label} {uid} {host_pid}' entrypoint = '' if 'entrypoint' in container_config: -- cgit v1.2.3