Skip to content
Prev Previous commit
Next Next commit
Allow user=0 to be passed in create_container
Signed-off-by: Anthony Sottile <[email protected]>
  • Loading branch information
asottile authored and shin- committed Aug 10, 2018
commit cbc7623ea09fd63a75f74378da11bd7cf266e32c
2 changes: 1 addition & 1 deletion docker/types/containers.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,7 +578,7 @@ def __init__(
'Hostname': hostname,
'Domainname': domainname,
'ExposedPorts': ports,
'User': six.text_type(user) if user else None,
'User': six.text_type(user) if user is not None else None,
'Tty': tty,
'OpenStdin': stdin_open,
'StdinOnce': stdin_once,
Expand Down
6 changes: 6 additions & 0 deletions tests/unit/types_containers_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from docker.types.containers import ContainerConfig


def test_uid_0_is_not_elided():
x = ContainerConfig(image='i', version='v', command='true', user=0)
assert x['User'] == '0'