docker

Docker - Disable Stream Buffers in Python

By Ganessh Kumar1 min read
  • python
  • docker

When running python application inside docker container, one may use print function for debugging. Usually it takes long time before you see anything on the screen as python tries to buffer the output to stdout and stderror. To force python to print immediately, set the environmental variable PYTHONUNBUFFERED=0 or run python with the flag -u inside the container. Both these force stdout and stderr stream to be unbuffered.

There is very little possibility that this variable might change, so you can configure via Dockerfile.

  • Dockerize Meteor Application

    Learn how to build and deploy a Meteor application using Docker and Docker Compose for a streamlined production environment.

    • docker
    • docker-compose
    • meteor
  • Containerize GUI Applications on Mac

    Learn how to containerize GUI applications on Mac OS X using Docker and XQuartz, with step-by-step instructions and troubleshooting tips.

    • docker

Keep reading

I write about full-stack development, developer tooling and the problems I run into building things. Here is everything else on the blog.