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)