Skip to content

Commit d19e8e6

Browse files
stepanstiplshin-
authored andcommitted
Allow custom PID mode for the container
Docker added support for sharing PID namespaces with other containers since version 1.12 (see moby/moby#22481). Signed-off-by: Stepan Stipl <[email protected]>
1 parent bc27829 commit d19e8e6

File tree

2 files changed

+1
-6
lines changed

2 files changed

+1
-6
lines changed

docker/utils/utils.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -752,9 +752,7 @@ def create_host_config(binds=None, port_bindings=None, lxc_conf=None,
752752

753753
host_config['ShmSize'] = shm_size
754754

755-
if pid_mode not in (None, 'host'):
756-
raise host_config_value_error('pid_mode', pid_mode)
757-
elif pid_mode:
755+
if pid_mode:
758756
host_config['PidMode'] = pid_mode
759757

760758
if ipc_mode:

tests/integration/api_container_test.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -365,9 +365,6 @@ def test_create_host_config_exception_raising(self):
365365
self.assertRaises(TypeError,
366366
self.client.create_host_config, mem_swappiness='40')
367367

368-
self.assertRaises(ValueError,
369-
self.client.create_host_config, pid_mode='40')
370-
371368
def test_create_with_environment_variable_no_value(self):
372369
container = self.client.create_container(
373370
BUSYBOX,

0 commit comments

Comments
 (0)