Implement group_add

This is part of the compose v2 spec, and may prove useful to allowing
the mistral-executor container to have membership to the docker group

Blueprint: container-prepare-workflow
Change-Id: Id4b4b7897d8f7da4eda33c1e5187514c234f3a79
This commit is contained in:
Steve Baker 2018-06-28 13:16:18 +12:00
parent bfeb2446bd
commit 56d6230002
2 changed files with 4 additions and 1 deletions

View File

@ -199,6 +199,7 @@ class ComposeV1Builder(object):
self.string_arg(cconfig, cmd, 'privileged', '--privileged', lower)
self.string_arg(cconfig, cmd, 'restart', '--restart')
self.string_arg(cconfig, cmd, 'user', '--user')
self.list_arg(cconfig, cmd, 'group_add', '--group-add')
self.list_arg(cconfig, cmd, 'volumes', '--volume')
self.list_arg(cconfig, cmd, 'volumes_from', '--volumes-from')
# TODO(sbaker): deprecate log_tag, implement log_driver, log_opt

View File

@ -484,7 +484,8 @@ three-12345678 three''', '', 0),
'env_file': ['/tmp/foo.env', '/tmp/bar.env'],
'ulimit': ['nofile=1024', 'nproc=1024'],
'volumes': ['/foo:/foo:rw', '/bar:/bar:ro'],
'volumes_from': ['two', 'three']
'volumes_from': ['two', 'three'],
'group_add': ['docker', 'zuul']
}
}
builder = compose1.ComposeV1Builder('foo', config, None)
@ -497,6 +498,7 @@ three-12345678 three''', '', 0),
'--env=FOO=BAR', '--env=BAR=BAZ',
'--rm', '--interactive', '--tty',
'--ulimit=nofile=1024', '--ulimit=nproc=1024',
'--group-add=docker', '--group-add=zuul',
'--volume=/foo:/foo:rw', '--volume=/bar:/bar:ro',
'--volumes-from=two', '--volumes-from=three',
'centos:7', 'ls', '-l', '/foo'],