3

I'm just getting started with docker, and I've been seeing a PYTHONUNBUFFERED environment variable in every Dockerfile for python. Can anyone kindly explain what it actually is?

DeeStarks
  • 320
  • 5
  • 16
  • https://github.com/aws/amazon-sagemaker-examples/issues/319 – Nirmal Dey May 08 '21 at 12:10
  • check this out:https://stackoverflow.com/questions/59812009/what-is-the-use-of-pythonunbuffered-in-docker-file/59812588 – Orion May 08 '21 at 12:22
  • 1
    Force the stdout and stderr streams to be unbuffered. This option has no effect on the stdin stream. https://docs.python.org/3/using/cmdline.html Setting PYTHONUNBUFFERED to a non empty value ensures that the python output is sent straight to terminal (e.g. your container log) without being first buffered and that you can see the output of your application (e.g. django logs) in real time. This also ensures that no partial output is held in a buffer somewhere and never written in case the python application crashes. – Arash Jun 30 '21 at 14:26

0 Answers0