-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
Hi,
I need to run a long time command in a container and print the stdout/stderr in live.
From what I have done so far I have to wait the end of the execution before being able to see the output logs.
For example, in the above code, I would like to be able to see "hello" before waiting the end of the 20secs:
import docker
client = docker.from_env()
container = client.containers.run('python:alpine', '''python -c "
import time;
print('hello');
time.sleep(20);
print('OK')"''',
detach=True, remove=True)
Many thanks for your help.
Metadata
Metadata
Assignees
Labels
No labels