diff options
author | Christian Breunig <christian@breunig.cc> | 2024-12-09 22:13:26 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-09 22:13:26 +0100 |
commit | 3ed6f02a66fd9d02a4cc3c45b2605cb3d8ad0d2e (patch) | |
tree | 7cf2ba952508537dbbd8fbae8bf574033db4d434 /src | |
parent | 6733ebcf129193a373eca870ebe5f2d6d65b9476 (diff) | |
parent | 1db8a48a8b9d1b7b125d9ca29cc4c48534640375 (diff) | |
download | vyos-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-x | src/conf_mode/container.py | 7 |
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: |