0

I'm planning to write an app that can remotely control as well as interact with a container. Now the only problem is to handle the output.

With the help of docker-py, I can control docker. However, I want to control the STDOUT of the container. For example, I run a logging system in the container and want to redirect the output log to python STDOUT simultaneously or to the remote client.

How show I do it with docker-py or any other ways to implement it?

ucag
  • 275
  • 1
  • 6
  • 20
  • Like https://docker-py.readthedocs.io/en/stable/containers.html#docker.models.containers.Container.attach or https://docker-py.readthedocs.io/en/stable/containers.html#docker.models.containers.Container.logs ? – Klaus D. Aug 26 '18 at 10:53
  • Yes, quite similar.Using `logs` works fine for the most situations. However, when run some commands like `vim` or `passwd` ,which needs interactions, I don't know how to cope with it... – ucag Aug 26 '18 at 12:40

0 Answers0