title: Docker - centos 7 CMD yum commands run but don't install
body: <p>I'm fairly new to Docker, and when attempting to install packages via the "Dockerfile" I've noticed that the build steps pass, but when i connect to the docker and load a shell, none of the packages have actually been installed.</p>
  
  <p>Config:</p>
  
  <pre><code>FROM centos:latest
  CMD yum -y install epel-release
  CMD yum -y install collectd
  </code></pre>
  
  <p>Build steps:</p>
  
  <pre><code>Sending build context to Docker daemon 40.45 kB
  Step 1/3 : FROM centos:latest
  ---&gt; 67591570dd29
  Step 2/3 : CMD yum -y install epel-release
   ---&gt; Using cache
   ---&gt; 4148233bce10
  Step 3/3 : CMD yum -y install collectd
  ---&gt; Using cache
  ---&gt; 62998bf2ce0f
  </code></pre>
  
  <p>When connecting to the docker neither package is installed, but I am able to install the packages within the docker:</p>
  
  <pre><code>[root@cassiopeia monitoringDocker]# docker exec -it 0579169abb44 bash
  [root@0579169abb44 /]# yum -y install epel-release
  Loaded plugins: fastestmirror, ovl
  base
  </code></pre>
  
  <p>Please help! </p>