summaryrefslogtreecommitdiff
path: root/src/conf_mode/container.py
diff options
context:
space:
mode:
authorChristian Poessinger <christian@poessinger.com>2022-11-05 19:47:42 +0100
committerChristian Poessinger <christian@poessinger.com>2022-11-05 19:47:42 +0100
commitacf2c24f8eec0918ca419db68196c76dc827f197 (patch)
treea302febedc014a124b2d94b33830c5a79c77ef19 /src/conf_mode/container.py
parent6c0473efd27205d6f51ee1726b46f5898b723cd3 (diff)
downloadvyos-1x-acf2c24f8eec0918ca419db68196c76dc827f197.tar.gz
vyos-1x-acf2c24f8eec0918ca419db68196c76dc827f197.zip
container: T4802: support per container shared-memory size configuration
Size of /dev/shm within a container can be defined via --shm-size when invoking the container. Add corresponding CLI node.
Diffstat (limited to 'src/conf_mode/container.py')
-rwxr-xr-xsrc/conf_mode/container.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/conf_mode/container.py b/src/conf_mode/container.py
index 70d149f0d..8efeaed54 100755
--- a/src/conf_mode/container.py
+++ b/src/conf_mode/container.py
@@ -207,6 +207,7 @@ def verify(container):
def generate_run_arguments(name, container_config):
image = container_config['image']
memory = container_config['memory']
+ shared_memory = container_config['shared_memory']
restart = container_config['restart']
# Add capability options. Should be in uppercase
@@ -254,9 +255,9 @@ def generate_run_arguments(name, container_config):
volume += f' -v {svol}:{dvol}'
container_base_cmd = f'--detach --interactive --tty --replace {cap_add} ' \
- f'--memory {memory}m --memory-swap 0 --restart {restart} ' \
+ f'--memory {memory}m --shm-size {shared_memory}m --memory-swap 0 --restart {restart} ' \
f'--name {name} {device} {port} {volume} {env_opt}'
-
+
if 'allow_host_networks' in container_config:
return f'{container_base_cmd} --net host {image}'