简体   繁体   English

使用Boot2Docker直接访问容器

[英]Direct access to containers using Boot2Docker

As part of using Docker as a development tool, I want direct access to docker containers that Boot2Docker has brought up. 作为使用Docker作为开发工具的一部分,我希望直接访问Boot2Docker提出的docker容器。

For example if 例如,如果

docker inspect {container id} docker inspect {container id}

says the ip is 172.17.0.5, I would like to be able to connect to the container via that ip address. 说ip是172.17.0.5,我希望能够通过该ip地址连接到容器。

I'm completely against mounting ports on the boot2docker vm and connecting via them, it wont work for me long term. 我完全反对在boot2docker vm上安装端口并通过它们连接,它对我来说不会长期工作。

Is there any kind of virtualbox config I can change to allow that kind of direct access. 是否有任何类型的虚拟机配置我可以更改以允许这种直接访问。

This worked perfectly : sudo route -n add 172.17.0.0/16 boot2docker ip 这完美地工作:sudo route -n add 172.17.0.0/16 boot2docker ip

Found the answer on a comment here : http://ispyker.blogspot.co.uk/2014/04/accessing-docker-container-private.html 在这里找到答案的评论: http//ispyker.blogspot.co.uk/2014/04/accessing-docker-container-private.html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM