Because, even if there is no full operating system involved, the file system in the Docker image looks like an extract of the root file system of a specific distro:
- depending on "origin OS", to install additional packages in the Docker file, you will have to run
yum
, apt
, or something else, and in case of apt
you will use either the Debian or Ubuntu repos.
- a few things (especially in
/etc
) aren't handled exactly the same across distributions (for instance, security certificates) so if you are familiar with Debian you'll be more at ease with a Debian/Ubuntu docker image than with a Centos one.
- there are some less visible things that can come into play while being just as important, such as actual names and releases of specific packages. Some Docker images (Alpine?) don't even contain
glib
, which is the C runtime support for many Linux applications.
Otherwise, an "OS Docker image" is just a starting point for a more specialized image. For instance,
if you need a web server, you start from an Debian image, use apt to install Apache and Tomcat, add your WARs. To debug your image you still have the whole range of utilities. When everything is stable you can remove the excess (typically doing a two-stage Dockerfile) and end up with a small image that contains just what is required for your server (Apache is just an example here, since you can find Apache images).
Please, for God's sake!, do NOT call this question "too broad" and vote to have it closed. Don't bully us here. – Harry – 2019-08-03T04:49:27.913
1There are “OS images” for most popular Linux distributions. They are typically used to build application images upon. Is that perhaps what you’re confused about? – Daniel B – 2019-08-03T15:47:12.757
@DanielB Yup, looks like it. Wish, this was explained CLEARLY early on in Docker documentation. Almost every article or tutorial uses a Ubuntu (or another OS) image (WHILE ALSO calling Docker an app container) without ever expressly stating what you just stated. Thanks. – Harry – 2019-08-04T00:46:13.117