title: Docker : Why the Commands from Dockerfile were not being executed?
body: <p>I have a query regarding the execution of commands in a container from the Dockerfile. </p>
  
  <pre><code>#Dockerfile Content:
    FROM ubuntu:14.04
    MAINTAINER RAGHU
    RUN echo "hello World"
  </code></pre>
  
  <hr>
  
  <h1>Build procedure</h1>
  
  <pre><code> docker build -t helloworld .
   Sending build context to Docker daemon 20.04 MB
   Step 1 : FROM ubuntu:14.04
   ---&gt; b1719e1db756
   Step 2 : MAINTAINER RAGHU
   ---&gt; Using cache
   ---&gt; 1704b62d66e2
   Step 3 : RUN echo "hello World"
   ---&gt; Running in 2b513872628e
   hello World
   ---&gt; ff559047fd19
   Removing intermediate container 2b513872628e
   Successfully built ff559047fd19
  </code></pre>
  
  <hr>
  
  <h1>Query 1: Why does  the below execution has not resulted in any result ? I am expecting to print "hello World". What wrong has happened ?</h1>
  
  <pre><code> root@labadmin-VirtualBox:/home/labadmin# docker run ff559047fd19
   root@labadmin-VirtualBox:/home/labadmin# docker ps -a
   CONTAINER ID   IMAGE         COMMAND        CREATED     STATUS     PORTS         NAMES
   a8eede1874a2   ff559047fd19  "/bin/bash"    27 seconds ago Exited (0) 26 seconds ago  tiny_williams
   root@labadmin-VirtualBox:/home/labadmin# docker logs a8eede1874a2
   #Above command has not resulted in any logs for this container.
  </code></pre>
  
  <h1>Query 2 :I am able to run the execution steps in the following way.  Why it has executed the command in the below container and why not when I run the container a8eede1874a2 ?</h1>
  
  <pre><code> root@labadmin-VirtualBox:/home/labadmin# docker run -it ff559047fd19
   root@486595ac9110:/# echo "hello world"
   hello world
   root@486595ac9110:/# exit
   exit
   root@labadmin-VirtualBox:/home/labadmin/RAGHU/welcome-page# docker ps -a
   CONTAINER ID   IMAGE   COMMAND      CREATED         STATUS         PORTS  NAMES
   486595ac9110   ff559047fd19  "/bin/bash"  22 seconds ago Exited (0) 7 seconds ago    goofy_noyce
   a8eede1874a2   ff559047fd19   "/bin/bash"  About a minute ago  Exited (0)      About a minute ago   tiny_williams
   root@labadmin-VirtualBox:/home/labadmin# docker logs 486595ac9110
   root@486595ac9110:/# echo "hello world"
   hello world
   root@486595ac9110:/# exit
   exit
   root@labadmin-VirtualBox:/home/labadmin/RAGHU/welcome-page# 
  </code></pre>