1

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:

  1. 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...

  1. 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?
  • l2bridge requires Windows Server 2016 or Windows 10 Creators Update. – harrymc Nov 17 '17 at 14:24
  • I understand that the docker documentation says that, but according to winver, both him and I are running the same version of windows, 1607 anniversary update, same build number. Yet it works on mine and not his. – Brian Deragon Nov 18 '17 at 14:37
  • As you are in a situation that is not guaranteed by the documentation, the difference might be that you have a better network driver, or that some Windows updates are missing on the other computer. Maybe you should both update to Windows 10 Creators Update (version 1703). – harrymc Nov 18 '17 at 16:56
1

According to Microsoft's article Windows Container Networking :

l2bridge - containers attached to a network created with the 'l2bridge' driver will be in the same IP subnet as the container host. The IP addresses must be assigned statically from the same prefix as the container host. All container endpoints on the host will have the same MAC address due to Layer-2 address translation (MAC re-write) operation on ingress and egress.

Requires Windows Server 2016 or Windows 10 Creators Update

As you and your colleague are on Windows 10 version 1607 (Anniversary update), you are both in a situation that is not guaranteed by the documentation. The difference why this is working for you and not for him might be some software or Windows updates that are installed on your computer but not on his, for example another network driver.

I think you should both update to Windows 10 Creators Update (version 1703) and also verify that your Docker versions are the same.

| improve this answer | |
  • Unfortunately, we're on corporate laptops, managed by a corporate release cycle, there is 0 way for us to update, we're restricted to Anniversary edition until early next year. We're also guaranteed to have the same updates because of that, and me and him run the exact same laptop. – Brian Deragon Nov 21 '17 at 13:43
  • I've made a lot of adjustments to my firewall, but I already checked that, he had a stock firewall pretty much; I believe its another issue from a configuration side, and was just looking for more ideas to check, like the firewall settings, or like the docker settings (I had experimental features checked, he didn't, but we fixed that too and it still didn't work) – Brian Deragon Nov 21 '17 at 13:44
  • Are your laptops totally identical - same Windows updates, drivers and applications? – harrymc Nov 21 '17 at 15:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.