dockerdocker-buildpython-manylinux

Where does Docker image initial filesystem come from?


I'm looking at manylinux1 stock image build scripts at https://github.com/pypa/manylinux, specifically the call chain:

The script assumes that a base CentOS 5 filesystem (e.g. /etc/yum) is already present. Where does it come from?

I don't see any references to a stock image, or anything like downloading it from somewhere, or using an installation ISO. Neither is there an /etc anywhere in the codebase.


Solution

  • Looking at the Dockerfile for the manylinux image, you can see that it is based on centos:5.11

    FROM centos:5.11
    MAINTAINER The ManyLinux project
    ...
    

    The /etc/yum folder is already part of the centos image, which can be verified by running: docker run -it centos:5.11 ls /etc/yum

    Update:

    Docker images are built in a layer structure defined inside a Dockerfile. Images build on top of each other, by using the FROM syntax inside a Dockerfile.

    In this case, the image is based on centos:5.11 image. The syntax is explained at docker tag | Docker Documentation (go figure). In this case, there's no directory address, which means it's retrieved from centos entry in the default Docker Hub registry, the one with the 5.11 tag.

    The Dockerfile for CentOS is very simple. It just expands a tarball with the base CentOS file structure into a scratch (empty) docker image. This tarball, centos-7-docker.tar.xz in the case of the latest version, contains the /etc/yum folder, among others.