Note

Anaconda and Docker Buffer Output With Python Application

Feb 08, 2023

I deploy Docker containers that run a Python application through a conda environment. The logging out of Python application would buffer until the container terminated, which makes troubleshooting difficult. It turns out that Anaconda w...

I deploy Docker containers that run a Python application through a conda environment. The logging out of Python application would buffer until the container terminated, which makes troubleshooting difficult. It turns out that Anaconda will indeed buffer the output unless directed otherwise. The way to tell conda not to buffer is to use the "--no-capture- output” flag. So here’s how I set that in my Docker file: ENTRYPOINT ["conda", "run", "--no-capture-output", "-n", "ldm"] CMD ["python3", "app.py"]