Running CentOS 6 In A Docker Container On A Non-CentOS Host

Home » CentOS » Running CentOS 6 In A Docker Container On A Non-CentOS Host
CentOS 4 Comments

I have to support a legacy build that runs on CentOS 6. I’m new to Docker and would like to use the official CentOS 6.10 image (https://github.com/CentOS/sig-cloud-instance-images/blob/da050e2fc6c28d8d72d8bf78c49537247b5ddf76/docker/Dockerfile ) as a Docker container on another host (probably some flavor of Ubuntu), but can’t figure out how to tell Docker to find that image. I also need to make some specific customizations that I would like to distribute locally but not share with upstream. Can somebody point me to some HOWTOs or tutorials? Most Google searches return how to run Docker on CentOS, which is not what I’m after.

Thanks, Alfred

4 thoughts on - Running CentOS 6 In A Docker Container On A Non-CentOS Host

  • You can use singularity. The following example makes an image by pulling from CentOS on dockerhub:

    singularity build c6.10.scif docker://CentOS:6.10

    If you have an old binary, foo.x outside the container you can then:

    singularity exec ./c6.10.scif ./foo.x

    None of this requires root.

    More on singularity: https://sylabs.io/docs/

    /Peter

  • Interesting! However, I would prefer to use more “native” Docker commands, as I would rather not have all developers install and configure Singularity when they already have Docker installed on their systems. There has got to be a way to configure Docker to grab an image from the official CentOS Docker repository (or whatever the correct terminology is for that).

    Thanks, Alfred

  • Docker could pull from the same dockerhub url as singularity. I just used singularity in my example because thats what I use and know. Its main advantage is the no-root-required part..

    /Peter