title: Why the RUN command in this dockerfile is not working
body: <p>I have a docker image (MyBaseImage) where I have Open SSH server installed. Now in the docker file, I have the following.</p>
  
  <pre><code>#Download base image
  FROM MyBaseImage
  
  RUN service ssh start
  </code></pre>
  
  <p>I build the new image by typing </p>
  
  <p><code>docker build .</code></p>
  
  <p>Docker builds the image fine, giving the following information.</p>
  
  <pre><code>Step 1/2 : FROM MyBaseImage
   ---&gt; 56f88e347f77
  Step 2/2 : RUN service ssh start
   ---&gt; Running in a1afe0c2ce71
   * Starting OpenBSD Secure Shell server sshd                             [ OK ]
  Removing intermediate container a1afe0c2ce71
   ---&gt; 7879cebe8b6a
  </code></pre>
  
  <p>But when I run the new image by typing </p>
  
  <p><code>docker run -it 7879cebe8b6a</code></p>
  
  <p>Typing the following in the terminal of the container </p>
  
  <p><code>service ssh status</code> </p>
  
  <p>gives </p>
  
  <p><code>* sshd is not running</code> </p>
  
  <p>I have to then manually start the Open SSH server by typing <code>service ssh start</code>. </p>
  
  <p>What could be the reason for it?</p>