Why is docker python image based specifically on Debian Buster?

Totally new to docker, sorry if the question is too basic and naive. I also asked some similar docker related questions on stackoverflow, but they say We don’t allow questions about general computing hardware and software on Stack Overflow. So hopefully this forum is more apt for it.

I am building a docker container starting from python 3.6 as my base image for my flask application. The first line of the Dockerfile looks like

FROM python:3.6.9

When I get inside the container and want to see the OS version, it shows debian.

# cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 10 (buster)"
NAME="Debian GNU/Linux"
VERSION="10 (buster)"

I understand any python interpreter has to be hosted by an operating system, but why Debian buster in particular when I have not mentioned that anywhere? Why not, for example, based on Linux Mint or Arch? If, for example, I want a python application to run on Manjaro, then do I have to start from Manjaro base image with FROM manjaro and install the utilities in my Dockerfile to get where I want?

In general, whenever I pick a higher level image like Python, how does Docker pick the lower level components such as the OS. Is there a default list somewhere?

1 Like

The python:3.6.9 tag simply inherits the “os” from its base image, which happens to be Debian buster for this image.

The python repository usualy provides several tags for the same python version based on different base images, though for this repo the range is limited to Debian, Alpine and Windows versions. On Dockerhub, you can click the “tags” tab and enter the version you want in the search field (the one with the magnifier glass icon) and check the available tags yourself.

May I suggest this faboulus, free, self paced docker training to build up a better understanding of docker? https://container.training/intro-selfpaced.yml

1 Like

The python:3.6.9 tag simply inherits the “os” from its base image

Yes, this what I am asking. So, if for example I want python3.6.9 running on Linux Mint or Manjaro, how would the dockerfile look like? Would you mind to give an example, whether by entering the sample docker commands here or by pointing me to some reference/github project etc.?

So this boild down to let me to a “let me google this for you” request.

The first result of googling “python docker github” is https://github.com/docker-library/python, which is the Github repo of the official python image. Check the different Dockerfiles.

Also, I would like to suggest this fabulous free self-paced docker training to get a better understanding of how Docker works and things need to be done: https://container.training/intro-selfpaced.yml.html
Of course building images is covered there as well.

Good luck!