I am trying to use docker-py to start a docker container and put me in a bash shell in that container. I get to start the container (I can see it using docker ps , and I can attach it very well with my own docker ps client), but when I use attach() from the official Python library, it just gives me an empty string in response . How to connect to my bash shell?
>>> import docker >>> c = docker.Client() >>> container = c.create_container(image='d11wtq/python:2.7.7', command='/bin/bash', stdin_open=True, tty=True, name='docker-test') >>> container {u'Id': u'dd87e4ec75496d8369e0e526f343492f7903a0a45042d312b37859a81e575303', u'Warnings': None} >>> c.start(container) >>> c.attach(container) ''
python docker dockerpy
d11wtq
source share