简体   繁体   中英

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.

For example if

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.

I'm completely against mounting ports on the boot2docker vm and connecting via them, it wont work for me long term.

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

Found the answer on a comment here : http://ispyker.blogspot.co.uk/2014/04/accessing-docker-container-private.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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