This means that it is not possible to run a MongoDB container with the data directory mapped to the host.ĭocker-compose version 1.20.1, build 5d8c71b Unfortunately, the mechanism VirtualBox uses to share folders between the host system and the Docker container is not compatible with the memory mapped files used by MongoDB (see vbox bug, and related bug).
Docker mac os x no such host windows#
WARNING (Windows & OS X): The default Docker setup on Windows and OS X uses a VirtualBox VM to host the Docker daemon. Also, in prod we are using a managed service of mongodb and not a local mongo container. I would like to connect to my local mongodb on the host machine from inside my container, since mongodb cannot be mirrored inside a container using mapped volumes, and I would like to continue working with the same db when developing locally or containerized. I am open to workarounds or other ideas, but host mode would make this a lot easier :) Unfortunately, when I set that up, I only get empty responses from hitting port 80 or 443 locally when nginx is started up (aka what the OP said). The idea was that we could run nginx in network_mode: 'host' and then always reference 127.0.0.1:, which is exactly the same way we do it in production.
I did get that working with a sed command at startup and passing in the host IP as an environment variable, but then there is the problem of the Mac changing IPs, so every time Mac decides to change IPs, the developer needs to re-setup the whole environment. We could add nginx to the swarm or use container linking, but then we have to change our nginx config in production vs local dev because we run nginx directly on hosts in production. We run our services in Swarm mode with 1.13 (using docker compose v3), and then using another compose file, run nginx, which is supposed to communicate with each service. Each service and nginx are all in separate containers. We have nginx acting as a reverse proxy for our other services. I'll add our current use case that is failing right now: Both of these things work fine on linux with -net=host, and don't work as expected on a mac.Īpologies in advance if I'm conflating things that you guys see as distinct issues, but it would definitely help if someone from docker could provide some guidance on whether it's realistic to hope that -net=host will ever work the same way it does on linux.
If this is going to be where this issue is consolidated, please also take note of this thread that sounded like it might contain a workable solution but hasn't been commented on either way by someone from docker as far as I know.Īs far as use cases, I use docker to run an application that (1) scans the local network looking for other devices and needs to see their mac addresses, and (2) dynamically binds to a local port that will later be used by other hosts to contact it. There are plenty more issues related to net=host not working the way it does on linux, like #155 (which has the most useful information on it) and maybe #68 and #57