title: docker run -it over ssh: the input device is not a TTY
body: <p>I'd like to run a docker container interactively directly from an ssh command.</p>
  
  <p>My current code appears as follows (I'm using <code>echo hi</code> as a placeholder):</p>
  
  <pre><code>$ ssh vagrant@127.0.0.1 -p 2222 "docker run -ti ubuntu:xenial echo hi"
  the input device is not a TTY
  </code></pre>
  
  <p>I've also tried explicitly making an interactive login shell:</p>
  
  <pre><code>$ ssh vagrant@127.0.0.1 -p 2222 "bash -ilc 'docker run -ti ubuntu:xenial'"
  bash: cannot set terminal process group (-1): Inappropriate ioctl for device
  bash: no job control in this shell
  the input device is not a TTY
  </code></pre>
  
  <p>If I ssh and interactively run the command, it works great:</p>
  
  <pre><code>$ ssh vagrant@127.0.0.1 -p 2222
  Welcome to Ubuntu 14.04.5 LTS (GNU/Linux 4.4.0-34-generic x86_64)
  
   * Documentation:  https://help.ubuntu.com/
  ----------------------------------------------------------------
    Ubuntu 14.04.5 LTS                          built 2016-08-26
  ----------------------------------------------------------------
  Last login: Mon Oct 30 23:25:35 2017 from 10.0.2.2
  vagrant@vagrant:~$ docker run -ti ubuntu:xenial echo hi
  hi
  </code></pre>
  
  <p>What am I missing here?</p>