I have a docker compose file that looks like the following:
version: '3.2'
services:
service-one:
build: service-one
container_name: service-one
networks:
- my-custom-network
restart: unless-stopped
service-two:
depends_on:
- service-one
build: service-two
container_name: service-two
networks:
- my-custom-network
restart: unless-stopped
networks:
my-custom-network:
driver: l2bridge
This seems to work just fine on my machine by running docker-compose-up
, all the containers start, and they are networked with each other, and can reach the host through 0.0.0.0 if necessary (there were some services we couldn't containerize yet, that the host is required to run).
However, on another developer's machine, he downloads everything, and runs docker-compose up
; it creates the network, the machines start, but he can't reach them. If he does a docker network inspect my-custom-network
, it does show the network has been created, and ip addresses have been assigned, but entering those ip addresses into a browser, results in nothing.
We've tried manually building them one machine at a time, and placing them in the default "nat" network, and the machines are accessible if placed there.
So, I guess my question is two-part:
- Can I re-write my compose file to use the default nat network, while still getting the benefit of the service name as the hostname? (service-two is expecting to be able to reference http://service-one/); I know in Creators Update (not available to use, we're behind a corporate update system) I can create multiple nat networks, but since we're on Anniversary Edition, we can't.
Or...
- Why isn't his l2bridge working? Mine is working just fine, I know it says on the official documentation for the l2bridge, that you need the Creators Update, but neither of us are running it currently, and it still works fine on my machine, and not on his. We use the same network, with the same access rights to it, same proxies, same subnet, same dhcp servers, same corporate firewall configuration, same group policy, same set of windows updates. Why would mine work and not his?