
This is not necessarily the case with the long-term support distributions. The “official” Docker image has the benefit of providing every version of Python you might want, and tends to be very up-to-date with bugfix releases. Their uncompressed on-disk sizes are 125MB and 48MB respectively.
#CIS BENCHMARK DOWNLOAD UBUNTU 16.04 DOWNLOAD#
This lacks the common packages’ layers, and so the image itself is much smaller, but if you use many other “official” Docker images the overall disk usage will be somewhat higher.įor comparison purposes, the download size of python:3.10-slim-bullseye is 45MB, and python:3.10-alpine is 18MB.

The image itself is large, but the theory is that these packages are installed via common image layers that other official Docker images will use, so overall disk usage will be low. Debian “Bullseye” 11, with many common packages installed.Alpine Linux, which as I explained above I don’t recommend using.Ubuntu 22.04 will have security updates until 2032, and 20.04 until 2030.Īnother alternative is Docker’s own “official” python image, which comes pre-installed with multiple versions of Python ( 3.8, 3.9, 3.10, etc.), and has multiple variants: RHEL 8 will have security updates until 2029.You can instead use other clones OracleLinux, RockyLinux or Alma Linux. Previous versions of this article covered CentOS, but CentOS is no longer a long-term stable operating system.Ubuntu and RHEL have backported newer versions of Python, so even though they are older than Debian 11 they still include Python 3.9. There are three major operating systems that roughly meet the above criteria: Debian “Bullseye” 11, Ubuntu 20.04 LTS, and RedHat Enterprise Linux 8. Option #1: Ubuntu LTS, RedHat Universal Base Image, Debian You can see the linked article for details, but I recommend against using Alpine. Why you shouldn’t use Alpine LinuxĪ common suggestion for people who want small images is to use Alpine Linux, but that can lead to longer build times, obscure bugs, and performance issues. The need for stability suggests not using operating systems with limited support lifetime, like Fedora or non-LTS Ubuntu releases. Small images: All things being equal, it’s better to have a smaller Docker image than a bigger Docker image.Up-to-date Python: While this can be worked around by installing Python yourself, having an up-to-date Python available saves you some effort.Extensive dependencies: For some applications less popular dependencies may be required-a base image with access to a large number of libraries makes this easier.Up-to-date dependencies: Unless you’re building a very simple application, you will likely depend on operating system-installed libraries and applications (e.g.Security updates: You want the base image to be well-maintained, so that you get security updates for the base operating system in a timely manner.Stability: You want a build today to give you the same basic set of libraries, directory structure, and infrastructure as a build tomorrow, otherwise your application will randomly break.There are a number of common criteria for choosing a base image, though your particular situation might emphasize, add, or remove some of these:

Need to ship quickly, and don’t have time to figure out every detail on your own? Read the concise, action-oriented Python on Docker Production Handbook. Note: Outside any specific best practice being demonstrated, the Dockerfiles in this article are not examples of best practices, since the added complexity would obscure the main point of the article.
#CIS BENCHMARK DOWNLOAD UBUNTU 16.04 SERIES#
