Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerpty not compatible with docker version 3.0.0 #79

Open
falu2010 opened this issue Feb 2, 2018 · 2 comments · May be fixed by #83
Open

Dockerpty not compatible with docker version 3.0.0 #79

falu2010 opened this issue Feb 2, 2018 · 2 comments · May be fixed by #83

Comments

@falu2010
Copy link

falu2010 commented Feb 2, 2018

Looks like dockerpty is not compatible with docker version 3.0.0.

@vanpelt
Copy link

vanpelt commented Feb 17, 2019

It actually works with 3.0.0, you just need to pass in the low level api to start.

image = "nginx"
dir = "/app"
cwd = os.getcwd()
container = client.api.create_container(
        image,
        "/bin/sh",
        volumes=[dir],
        host_config=client.api.create_host_config(
            binds={cwd: {"bind": dir, 'mode': 'rw'}}
        ),
        stdin_open=True,
        tty=True,
        environment={
            "LANG": "C.UTF-8"
        }
    )
    dockerpty.start(client.api, container)

@lacek
Copy link

lacek commented Jun 4, 2019

It also works with client.containers.create with a simple replacement of container by container.id in the call of start:

client = docker.from_env()
container = client.containers.create(...)
dockerpty.start(client.api, container.id)

@tedivm tedivm linked a pull request Oct 16, 2019 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants