title: How to restart container using container-id?
body: <p>I created a container using the command <br></p>
  
  <pre><code>docker run ubuntu /bin/bash -c "echo 'cool content' &gt; /tmp/cool-file"
  </code></pre>
  
  <p>Now I see the container has exited<br></p>
  
  <pre><code>CONTAINER ID        IMAGE               COMMAND                  CREATED             STATUS                      PORTS               NAMES
  9e5017aef3f9        ubuntu              "/bin/bash -c 'echo '"   38 seconds ago      Exited (0) 36 seconds ago                       elegant_euler
  </code></pre>
  
  <p>Question: How can I restart and get in to the interactive mode for this container using its <strong>container-id</strong>?<br>
  I cannot use <code>docker run -it &lt;image_name&gt;</code> since this expects image name and not container id.
  I tried using docker attach  , but I think this only works for running containers.
  I don't want to commit this container just yet so, how can I restart and get in to interactive mode for this container using it's container-id?<br>
  EDIT: I'm able to get in to other containers using <code>docker start {container-id}</code> and then running <code>docker attach {container-id}</code>. I wonder if there is something peculiar with the way I created the container which would result in this behavior. I'm just starting out with docker so do direct me in right direction if I'm missing some basic bit.</p>