summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-12-09 22:13:26 +0100
committerGitHub <noreply@github.com>2024-12-09 22:13:26 +0100
commit3ed6f02a66fd9d02a4cc3c45b2605cb3d8ad0d2e (patch)
tree7cf2ba952508537dbbd8fbae8bf574033db4d434 /src
parent6733ebcf129193a373eca870ebe5f2d6d65b9476 (diff)
parent1db8a48a8b9d1b7b125d9ca29cc4c48534640375 (diff)
downloadvyos-1x-3ed6f02a66fd9d02a4cc3c45b2605cb3d8ad0d2e.tar.gz
vyos-1x-3ed6f02a66fd9d02a4cc3c45b2605cb3d8ad0d2e.zip
Merge pull request #4218 from nvollmar/T6927
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: