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

How to connect to docker container from shell_command #66

Open
nikhilkabbin opened this issue May 9, 2019 · 2 comments
Open

How to connect to docker container from shell_command #66

nikhilkabbin opened this issue May 9, 2019 · 2 comments

Comments

@nikhilkabbin
Copy link

I am trying to run a docker image from shell_command but getting an error

@martinzugnoni
Copy link

Any update on how to spawn the shell command inside a docker container? Particularly in my user case I would like to run a separated ipython kernel for each instance of xterm websocket connection. Is it possible in this way?

@simonMoisselin
Copy link

simonMoisselin commented Feb 29, 2020

Somehow, if I run the docker command as a list like this shell_command=["docker", "run", "-it", "--rm", "python:3.5-slim-buster"] instead of shell_command=["docker run -it --rm python:3.5-slim-buster"] , the error is not present anymore.

I think version 1 is easier to serialize. The error is coming from the library ptyprocess , and we can experiment using this code:

from ptyprocess import PtyProcessUnicode
pty = PtyProcessUnicode.spawn(["docker", "run", "-it","--rm", "python:3.5-slim-buster"])
pty.read(1000)

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

No branches or pull requests

3 participants