AX Semantics Developer Blog
  • Home
  • Categories
  • Tags
  • Archives

Fixing python output in a docker container

When you're executing python in a docker container you may encounter that all your output to stdout and/or stderr won't appear in the container logs. This is an output buffering problem. To fix it add PYTHONUNBUFFERED=0 to the environment. E.g. with this docker command:

docker run -e PYTHONUNBUFFERED=0 <yourimage>

Source:
http://stackoverflow.com/questions/23524976/capturing-output-of-python-script-run-inside-a-docker-container

Tell us what you think about this. Is something unclear? Do you have questions or ideas? Leave your comments below.

Comments
comments powered by Disqus

  • « CAcert and wildcards
  • Complex pytest-django example »

Published

Nov 10, 2014

Category

Berichtsheft

Tags

  • docker 6
  • howto 9
  • python 8
  • AX Semantics Developer Blog - Technical stuff and learnings we had while developing the AX environment
  • Powered by Pelican. Theme: Elegant by Talha Mansoor