How do I use a drush alias to connect to a docker container?
So this one threw me for a while this evening as well. 

Here's what ended working:

$aliases['docker'] = array(
  'uri' =&gt; 'http://localhost:8080',
  'php' =&gt; '/usr/bin/php',
  'root' =&gt; '/var/www',
  'remote-user' =&gt; 'root',
  'remote-host' =&gt; '0.0.0.0',
  'ssh-options' =&gt; '-p 8022 -o PasswordAuthentication=no -i ~/.ssh/id_rsa',
  'path-aliases' =&gt;
  array (
    '%drush' =&gt; '/root/.composer/vendor/drush/drush/drush'
  )
);


The remote host of 0.0.0.0 ended up doing the trick. Seems that if you use localhost or 127.0.0.1 drush doesn't actually try to ssh in.