Skip to content

Commit 09defa6

Browse files
committed
Always send a string for the user param in create_container
1 parent 33acb9d commit 09defa6

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

docker/utils/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -715,7 +715,7 @@ def create_container_config(
715715
'Hostname': hostname,
716716
'Domainname': domainname,
717717
'ExposedPorts': ports,
718-
'User': user,
718+
'User': '{0}'.format(user) if user else None,
719719
'Tty': tty,
720720
'OpenStdin': stdin_open,
721721
'StdinOnce': stdin_once,

tests/integration_test.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1624,3 +1624,6 @@ def test_649(self):
16241624
ctnr = self.client.create_container('busybox', ['sleep', '2'])
16251625
self.client.start(ctnr)
16261626
self.client.stop(ctnr)
1627+
1628+
def test_715(self):
1629+
self.client.create_container('busybox', 'true', user=1000)

0 commit comments

Comments
 (0)