title: Docker container exits immediately after DOCKER RUN command
body: <p>Please do not ignore this, I have tried to go through the other solutions proposed on the forum and none solved my problem. </p>
  
  <p>I am kick-starting with Docker and the DevOps stuff. Started with the basic get-started tutorial on their <a href="https://docs.docker.com/get-started/part2/#build-the-app" rel="nofollow noreferrer">page</a>. I am unable to run the application as described in the tuto,</p>
  
  <pre><code>$ docker --version  
  Docker version 17.06.0-ce, build 02c1d87
  </code></pre>
  
  <p>I am running docker on <code>Ubuntu 16.04 LTS</code>, the following are the different verifications i did</p>
  
  <pre><code>$ docker images
  REPOSITORY          TAG                 IMAGE ID            CREATED             SIZE
  friendlyhello       latest              cb003cf9993a        6 minutes ago       194MB
  python              2.7-slim            451c85955bc2        7 days ago          182MB
  hello-world         latest              1815c82652c0        6 weeks ago         1.84kB
  
  $ docker ps -a
  CONTAINER ID        IMAGE               COMMAND             CREATED             STATUS                     PORTS               NAMES
  7d094e902b93        friendlyhello       "python app.py"     7 minutes ago       Exited (0) 7 minutes ago                       awesome_fermi
  9d358777b84d        hello-world         "/hello"            3 hours ago         Exited (0) 3 hours ago                         eloquent_euclid
  </code></pre>
  
  <p>I noticed that actually when i run an application, the <code>Status</code> is <code>Exited</code> as shown above.</p>
  
  <pre><code>$ Curl http://localhost:4000
  curl: (7) Failed to connect to localhost port 4000: Connection refused
  </code></pre>
  
  <p>The content of the <code>Dockerfile</code> is show below:</p>
  
  <pre><code>FROM python:2.7-slim
  WORKDIR /app
  ADD . /app
  RUN pip install -r requirements.txt
  EXPOSE 80
  ENV NAME World
  CMD ["python", "app.py"]
  </code></pre>