$ vagrant ssh-config Host phusion HostName 172.17.0.2 User root Port 22 UserKnownHostsFile /dev/null StrictHostKeyChecking no PasswordAuthentication no IdentityFile /home/matedev/docker_apps/phusion/insecure_key IdentitiesOnly yes LogLevel FATAL
コンテナのIPアドレスへ22ポートへ接続できます。
$ ssh -i insecure_key root@172.17.0.2 Warning: Permanently added '172.17.0.2' (ECDSA) to the list of known hosts. Last login: Sat May 17 12:09:33 2014 from 172.17.42.1 root@d419de25cc4a:~#
localhostにポートフォワードされた2222ポートで接続します。
$ ssh -l root -i insecure_key -p 2222 localhost Warning: Permanently added '[localhost]:2222' (ECDSA) to the list of known hosts. Last login: Sat May 17 12:16:34 2014 from 172.17.42.1 root@d419de25cc4a:~#
vagrant global-statusでVMとしてコンテナが起動しているのを確認できます。
$ vagrant global-status id name provider state directory ---------------------------------------------------------------------- 8bdfaed phusion docker running /home/matedev/docker_apps/phusion
$ vagrant destroy 8 default: Are you sure you want to destroy the 'default' VM? [y/N] y ==> default: Deleting the container... ==> default: Removing built image...