Simple Dockerfile examples are often broken by default
When it’s time to package up your Python application into a Docker image, the natural thing to do is search the web for some examples. Learn more about best-practices Docker images for Python. At that point rebuilding the image will switch to a different version of Python, which might break the software: a minor change in your code can lead to a deploy that breaks production.
Source: pythonspeed.com