Answer the question
In order to leave comments, you need to log in
docker pseudo-tty not showing message from python input() method?
Hello everyone. I'm creating a project to run untested code through an isolated Docker container.
I launch a docker container through the docker Python library:
client.containers.run('python', command='python main.py', auto_remove=True, detach=True, stdin_open=True, tty=True)
And connect it through the attachAddon plugin XtermJS with docker container:
terminal.loadAddon(new AttachAddon(new WebSocket("ws://domain/containers/id/attach/ws?logs=1&stream=1&stdin=1&stdout=1&stderr=1');
Everything works fine except input ("Text") of the method.
Here the "Text" should have been displayed in the console, and ask for data from the user.
But the "Text" is not displayed, you can only enter data.
It should be displayed like this:
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question