title: What is the purpose of a CentOS Docker image?
body: <p>From everything I've read and heard about Docker, the whole point of it is to encapsulate an application so that it is runnable on any machine. It achieves this by wrapping up the environment needed (tools/dependencies) into the docker image. A container is an instance of an image. There isn't an OS running in a docker container.</p>
  
  <p>Now, if that's all true, then why does this exist: <a href="https://hub.docker.com/_/centos" rel="noreferrer">CentOS official docker image</a>? I thought docker images were just for applications, not entire operating systems.</p>
  
  <p>Whenever I instantiate that image, I get a container that, when attached to it, appears to be a functioning CentOS shell.</p>
  
  <p>You can do it yourself to see what I mean:</p>
  
  <ul>
  <li>Dockerfile contents: <code>FROM centos:centos7</code></li>
  <li>Build the image: <code>docker build centos-img .</code></li>
  <li>Run the container: <code>docker run -ti centos-img</code></li>
  <li>To detach: <code>ctrl+p, ctrl+q</code></li>
  <li>To reattach: <code>docker attach &lt;container id&gt;</code></li>
  </ul>
  
  <p>This really looks and feels like a VM.</p>
  
  <p>If I run <code>cat /etc/os-release</code> it even says I am running CentOS.</p>
  
  <p>What exactly is this? Could I use a CentOS docker image as if it were a virtual machine? What are the limitations?</p>
  
  <p>(What's confusing me is <code>docker containers != VMs</code>, however, from by exploration, I created a docker image that looks and feels like a VM. Why would I ever want to run a VM again, if I can run a lightweight docker image that acts exactly like a VM?)</p>
  
  <hr>
  
  <p>Is this centOS docker image just a starting place, that I am supposed to build off of (ie, put my application in), so that it just functions as a host for my application? The more I read and dig into Dockerfile examples, the more I believe this is assumption is true.</p>
  
  <hr>
  
  <p>What I'm really trying to do:</p>
  
  <p>I have a bunch of small applications/services that function together as a system that make up a large application. I currently have this system running on a centOS machine. I want the ability to easily run multiple instances of this large application, each in their own environment / without stepping on each other's toes. Would it be possible to do this by using a <code>centOS docker image + all of the small applications/services needed</code>, resulting in a <code>large application image</code>? With this image, I can spin up multiple containers, each one running a separate instance of the large application? Is that a reasonable/achievable thing to do with Docker?</p>
  
  <hr>
  
  <p>Some of my understanding may be incorrect, or I may be suggesting to use Docker in a way that it is not meant to be used. If so, feel free to point it out. Thanks!</p>