N
N
Nauryzbek Aitbaev2020-03-04 08:36:31
Python
Nauryzbek Aitbaev, 2020-03-04 08:36:31

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:
5e5f3e0b46677574502637.png

5e5f3e540e54f965749625.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question