mirror of https://github.com/docker/compose.git
Add --pid=host support
Allow docker-compsoe to use the docker --pid=host API available in 1.17 Signed-off-by: Steven Dake <stdake@cisco.com>
This commit is contained in:
parent
11a2100d53
commit
94277a3eb0
|
@ -20,6 +20,7 @@ DOCKER_CONFIG_KEYS = [
|
|||
'links',
|
||||
'mem_limit',
|
||||
'net',
|
||||
'pid',
|
||||
'ports',
|
||||
'privileged',
|
||||
'restart',
|
||||
|
|
|
@ -25,6 +25,7 @@ DOCKER_START_KEYS = [
|
|||
'dns_search',
|
||||
'env_file',
|
||||
'net',
|
||||
'pid',
|
||||
'privileged',
|
||||
'restart',
|
||||
]
|
||||
|
@ -434,6 +435,7 @@ class Service(object):
|
|||
privileged = options.get('privileged', False)
|
||||
cap_add = options.get('cap_add', None)
|
||||
cap_drop = options.get('cap_drop', None)
|
||||
pid = options.get('pid', None)
|
||||
|
||||
dns = options.get('dns', None)
|
||||
if isinstance(dns, six.string_types):
|
||||
|
@ -457,6 +459,7 @@ class Service(object):
|
|||
restart_policy=restart,
|
||||
cap_add=cap_add,
|
||||
cap_drop=cap_drop,
|
||||
pid_mode=pid
|
||||
)
|
||||
|
||||
def _get_image_name(self, image):
|
||||
|
|
|
@ -419,6 +419,17 @@ class ServiceTest(DockerClientTestCase):
|
|||
container = create_and_start_container(service)
|
||||
self.assertEqual(container.get('HostConfig.NetworkMode'), 'host')
|
||||
|
||||
def test_pid_mode_none_defined(self):
|
||||
service = self.create_service('web', pid=None)
|
||||
container = create_and_start_container(service)
|
||||
print 'STEAK %s' % (container.get('HostConfig.PidMode'))
|
||||
self.assertEqual(container.get('HostConfig.PidMode'), '')
|
||||
|
||||
def test_pid_mode_host(self):
|
||||
service = self.create_service('web', pid='host')
|
||||
container = create_and_start_container(service)
|
||||
self.assertEqual(container.get('HostConfig.PidMode'), 'host')
|
||||
|
||||
def test_dns_no_value(self):
|
||||
service = self.create_service('web')
|
||||
container = create_and_start_container(service)
|
||||
|
|
Loading…
Reference in New Issue