title: Docker exec with ssh gives no such container Error
body: <p>I am trying to <code>ssh</code> directly into a docker container using the following commands:</p>
  
  <pre><code>CONTAINER_ID=`ssh user@host -t "docker ps | head -n 2 | tail -n 1 | cut -d' ' -f1"`
  ssh -tt user@host "docker exec -it $CONTAINER_ID /bin/bash"
  </code></pre>
  
  <p>When I do this I get:</p>
  
  <pre><code>Error: No such container: &lt;container_id&gt;
  </code></pre>
  
  <p>Even though if I run the <code>exec</code> on the instance itself, the container is there, and it does let me connect.</p>