New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support docker network route <network-name>
to provide client OS direct container access
#22429
Comments
I had the same need so I wrote a little daemon that listen for docker events to route network from the host interface to the VM interface. Basically on OS X I do the route add thing as you did and on the VM I just preallocate the ip addresses so that can be used by docker and routed by the host.
You can find more here: https://github.com/fntlnz/docker-machine-router P.S: my solution is currently limited to OS X using docker-machine. I'm also trying to "reverse engineer" the |
Hi, we would like to add this to docker for mac, but there are issues at the moment in terms of OS support on OSX. I did have it working as a prototype on an earlier version, but there are various reasons why it is difficult to support. For overlay networks it is also a problem as OSX does not have the necessary support, and Apple does not really support adding kernel modules. At the moment your best bet is to run the programs you want to access with in containers themselves. |
Sorry I don't know this stuff well... but is https://github.com/docker/vpnkit another way that I can get what I want? Instead of |
@jamshid unfortunately the overlay network drivers are not compatible with VPN clients, and there are no VPN overlay drivers yet. We are considering some VPN based approaches, but no decisions have been made. |
HyperKit supports it already moby/hyperkit#45 What are the complications to enable it by default? |
I would also love some public accessible status on this issue. It used to work in earlier version of Docker for Mac. It is one of the biggest selling points for us to go from Docker Toolbox and to Docker for Mac. |
@Multiply Routing from the osx host to the container network has never been supported in docker4mac. |
@cpuguy83 I had routing working in one of the early beta versions, maybe using different launch options, but I had it working, at least. |
Its be a very nice! |
Basic use case:
|
The current status with Docker Desktop for Mac is that the Linux VM is managed using HyperKit and does not expose a network interface to communicate directly with the Linux VM, so there is no way to route traffic into the Linux VM. The only way to access the Linux VM hosted containers is to configure them to expose ports, which will have the Docker Desktop for Mac open the relevant ports on the host's network interface. Maybe in the future Docker Desktop for Mac will also use VPNKit or something like that to create virtual network interfaces that map to the docker networks running in the Linux VM - at which point this issue will be moot - but until then there is nothing to do about this issue and I suggest closing it. |
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
Docker for Mac, but want this ability in all scenarios, including docker swarm.
Steps to reproduce the issue:
I want my docker client (laptop) to be able to provide direct access to docker containers by their ip address. This is very useful when you're running/debugging a program locally that needs to talk to a cluster of servers running within docker. I can't access by published ports, my local program needs direct access each container by ip.
This works (at least used to) on my macbook with a docker-machine virtualbox server:
but it does not work (I can't ping a container's ip) on Docker for Mac, or with Swarm, or a remote docker server (e.g. digitalocean).
Describe the results you received:
Describe the results you expected:
I expect to be able to
curl http://172.18.0.8
as if my macbook is in the container's network.Sorry I don't know enough about networking to know if or how this is possible. Maybe it's possible now with a unix script or by using the
weave
network plugin.This seems useful enough to be a "batteries included" feature.
The feature I'm imagining is
docker network route myproject_backend
will give the machine running the docker client an ip address on the docker network, e.g. created by adocker-compose
project that names its networkbackend
.The text was updated successfully, but these errors were encountered: