Docker Community Forums

Share and learn in the Docker community.

Connect directly to container


(Gforcespl) #1

Is it possible to connect directly to container?
In native docker environment there is possibility to connect with container via its IP address. E.g. nginx container is running. IP can be obtained using “docker inspect”. Navigating to http:// works as expected.
On OSX we’ve got xhyve in the middle so only using port mapping it is possible to access container. Is there possibility to create network bridge so it would be possible to connect in the same manner as in docker running natively? There are some cases where local service is running on given port and mapping is not possible/desired. For example 4 nginx servers running on 80 + dnsmasq service that would redirect to specific nginx container based on host.

Thanks in advance.


(Mbklein) #2

I came here looking for this as well. Even if it’s just a matter of routing the entire contained subnet through xhyve, this would be very useful.


(Gforcespl) #3

I’ve been able to connect to xhyve machine using screen:
screen ~/Library/Containers/com.docker.docker/Data/com.docker.driver.amd64-linux/tty
login is root. no password
Inside i can see docker0 bridge and gate to outside via eth0 with IP 192.168.65.2 and gateway on 192.168.65.1. However Im not able to trace how it translates to OSX routing aaaand my network-fu skill is wayyyy too low to grasp such knowledge :slight_smile: Maybe someone could shed some more light and/or try to propose some kind of solution :confused:


(Gforcespl) #4

For anyone interested here’s topic relevant to this problem:


Support tap interface for direct container access (incl. multi-host)
(Almirkadric) #5

This is related to the following topic: