There is a Dockerfile
as below
CMD ["python", "/app.py"]
ʻApp.py` has this:
print 'some log'
Start with docker run
:
docker run -d xxx
Look at the Log:
docke logs -f yyy
It's hard to get the expected Log.
I found that it was caused by the standard output buffer by Python.
If you want to see the Log immediately without buffering, just launch the app with python -u
.
After modifying the following, docker logs
was able to see the Log safely.
CMD ["python", "-u", "/app.py"]
Recommended Posts