I've stumbled upon a problem where some of my Docker containers only work when I configure the compose file with network_mode set to host. Specifically, they don't seem to function with normal port bindings. Anyone have any insights on why this might be happening? Thanks! Here's a snippet of my docker-compose file for reference:
```yaml
services:
whatsupdocker:
image: getwud/wud
container_name: wud
environment:
- WUD_WATCHER_LOCAL_CRON=0 6 * * *
ports:
- 3000:3000
volumes:
- /var/run/docker.sock:/var/run/docker.sock
```
2 Answers
It sounds like you need to provide a bit more context about your setup to figure this out. The format of your Docker Compose file looks fine, and it should definitely work without using the host network mode. Have you tried running the containers with full logs enabled to see what errors might show up? That could give you a hint.
Are you by any chance using Docker Desktop on Windows? I've heard that can mess with networking in some cases. If that's not it, maybe it's an issue with DNS settings or something in your `/etc/resolv.conf`. Just a thought!
Nope, I'm actually running on an Ubuntu server. I'm wondering if it's related to the DNS settings too, but everything looks fine at first glance.