The best Docker base image for Python
Last updated
Was this helpful?
Last updated
Was this helpful?
The official Docker Python image in its slim variantāe.g. python:3.9-slim-buster
āis a good base image for most use cases. itās 41MB to download, 114MB when uncompressed to disk, it gives you the latest Python releases, itās easy to use and itās got all the benefits of Debian Buster.
If you care about performance, youāll want to use ubuntu:20.04
. Having , it turns out that switching to Ubuntu 20.04 can give you a 20% performance boost. As such, if Python performance matters to you, I would recommend using the ubuntu:20.04
image. Itās a bit more annoying to set up, and for some reason gets updates less often, but it will be faster.
Ref: