

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.


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. Docker has a series of “official” Docker base images based on various Linux distributions, and also base images that package specific programming languages, in particular Python.
