Merge pull request #753 from docker/715-user-int-uid

Always send a string for the user param in create_container
This commit is contained in:
Joffrey F 2015-09-10 10:37:05 -07:00
commit de5aab87b4
2 changed files with 7 additions and 1 deletions

View File

@ -719,7 +719,7 @@ def create_container_config(
'Hostname': hostname,
'Domainname': domainname,
'ExposedPorts': ports,
'User': user,
'User': six.text_type(user) if user else None,
'Tty': tty,
'OpenStdin': stdin_open,
'StdinOnce': stdin_once,

View File

@ -1621,3 +1621,9 @@ class TestRegressions(BaseTestCase):
ctnr = self.client.create_container('busybox', ['sleep', '2'])
self.client.start(ctnr)
self.client.stop(ctnr)
def test_715(self):
ctnr = self.client.create_container('busybox', ['id', '-u'], user=1000)
self.client.start(ctnr)
self.client.wait(ctnr)
assert self.client.logs(ctnr) == '1000\n'