diff --git a/README.rst b/README.rst index 687db93..7b61d23 100644 --- a/README.rst +++ b/README.rst @@ -263,6 +263,9 @@ net: pid: String. Set the PID mode for the container. +uts: + String. Set the UTS namespace for the container. + privileged: Boolean, defaults to false. If true, give extended privileges to this container. diff --git a/paunch/builder/compose1.py b/paunch/builder/compose1.py index f328295..bda8a59 100644 --- a/paunch/builder/compose1.py +++ b/paunch/builder/compose1.py @@ -151,6 +151,8 @@ class ComposeV1Builder(object): cmd.append('--ipc=%s' % cconfig['ipc']) if 'pid' in cconfig: cmd.append('--pid=%s' % cconfig['pid']) + if 'uts' in cconfig: + cmd.append('--uts=%s' % cconfig['uts']) if 'healthcheck' in cconfig: hconfig = cconfig['healthcheck'] if 'test' in hconfig: diff --git a/paunch/tests/test_builder_compose1.py b/paunch/tests/test_builder_compose1.py index a295507..c05e23a 100644 --- a/paunch/tests/test_builder_compose1.py +++ b/paunch/tests/test_builder_compose1.py @@ -316,6 +316,7 @@ three-12345678 three''', '', 0), 'net': 'host', 'ipc': 'host', 'pid': 'container:bar', + 'uts': 'host', 'restart': 'always', 'healthcheck': { 'test': '/bin/true', @@ -335,7 +336,7 @@ three-12345678 three''', '', 0), ['docker', 'run', '--name', 'one', '--detach=true', '--env-file=/tmp/foo.env', '--net=host', '--ipc=host', '--pid=container:bar', - '--health-cmd=/bin/true', '--health-interval=30s', + '--uts=host', '--health-cmd=/bin/true', '--health-interval=30s', '--health-timeout=10s', '--health-retries=3', '--privileged=true', '--restart=always', '--user=bar', '--log-opt=tag={{.ImageName}}/{{.Name}}/{{.ID}}', 'centos:7'], diff --git a/releasenotes/notes/add-uts-242e7491dcb90a6c.yaml b/releasenotes/notes/add-uts-242e7491dcb90a6c.yaml new file mode 100644 index 0000000..6d6bc34 --- /dev/null +++ b/releasenotes/notes/add-uts-242e7491dcb90a6c.yaml @@ -0,0 +1,4 @@ +--- +features: + - | + Add option to configure container's UTS namespace.