如何将ssh转换为Docker-machine VirtualBox实例? [英] How to ssh into docker-machine VirtualBox instance?

查看:226
本文介绍了如何将ssh转换为Docker-machine VirtualBox实例?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

docker-machine版本0.2.0
docker版本1.6.2

docker-machine version 0.2.0 docker version 1.6.2

我正在使用 docker-machine使用VirtualBox创建机器。一切工作正常,但我想ssh进入机器本身,我没有找到关于如何做这个的指示。我可以连接到ssh端口:

I'm using docker-machine to create a machine using VirtualBox. Everything works fine but I'd like to ssh into the machine itself and I find no instructions on how to do this. I can connect to the ssh port:

ssh $(docker-machine ip dev)

但我不知道要使用什么用户名/密码/身份文件。

But I've no idea what username / password / identity file to use.

推荐答案

您可以通过运行

docker-machine ssh default

(在此使用默认主机)

身份文件应存储在〜/ .docker / machine / machines 之下。如果要登录到容器(而不是主机),请按照user2915097的建议使用 docker exec

The identity files should be stored under ~/.docker/machine/machines. If you want to log into a container (as opposed to the host), use docker exec as suggested by user2915097.

这篇关于如何将ssh转换为Docker-machine VirtualBox实例?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆