From 09defa66ba4f4fcea35cbc004fc1de54155911bf Mon Sep 17 00:00:00 2001 From: Joffrey F Date: Mon, 31 Aug 2015 16:06:52 -0700 Subject: [PATCH] Always send a string for the user param in create_container --- docker/utils/utils.py | 2 +- tests/integration_test.py | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docker/utils/utils.py b/docker/utils/utils.py index 8dc726b3..71511a4f 100644 --- a/docker/utils/utils.py +++ b/docker/utils/utils.py @@ -715,7 +715,7 @@ def create_container_config( 'Hostname': hostname, 'Domainname': domainname, 'ExposedPorts': ports, - 'User': user, + 'User': '{0}'.format(user) if user else None, 'Tty': tty, 'OpenStdin': stdin_open, 'StdinOnce': stdin_once, diff --git a/tests/integration_test.py b/tests/integration_test.py index fd4ff2d0..db4d131b 100644 --- a/tests/integration_test.py +++ b/tests/integration_test.py @@ -1624,3 +1624,6 @@ class TestRegressions(BaseTestCase): ctnr = self.client.create_container('busybox', ['sleep', '2']) self.client.start(ctnr) self.client.stop(ctnr) + + def test_715(self): + self.client.create_container('busybox', 'true', user=1000)