summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNicolas Vollmar <nvollmar@gmail.com>2024-12-01 16:25:05 +0100
committerNicolas Vollmar <nvollmar@gmail.com>2024-12-08 11:04:58 +0100
commitf9ddf3f68f42080efc471e934d6bdaa1fec17459 (patch)
tree6fee3bd729261f52a64fef2008ab72c3ba101151 /src
parentb56673ccdc0c304c8e9c12a9274a6903d45103a6 (diff)
downloadvyos-1x-f9ddf3f68f42080efc471e934d6bdaa1fec17459.tar.gz
vyos-1x-f9ddf3f68f42080efc471e934d6bdaa1fec17459.zip
T6927: adds option to set container name server
Diffstat (limited to 'src')
-rwxr-xr-xsrc/conf_mode/container.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/conf_mode/container.py b/src/conf_mode/container.py
index a7dc33d9d..4d3962029 100755
--- a/src/conf_mode/container.py
+++ b/src/conf_mode/container.py
@@ -363,9 +363,14 @@ def generate_run_arguments(name, container_config):
if 'allow_host_pid' in container_config:
host_pid = '--pid host'
+ name_server = ''
+ if 'name_server' in container_config:
+ for ns in container_config['name_server']:
+ name_server += f'--dns {ns}'
+
container_base_cmd = f'--detach --interactive --tty --replace {capabilities} --cpus {cpu_quota} {sysctl_opt} ' \
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} {host_pid}'
+ f'--name {name} {hostname} {device} {port} {name_server} {volume} {env_opt} {label} {uid} {host_pid}'
entrypoint = ''
if 'entrypoint' in container_config: