0

On two different machines (a desktop and a server), the same docker-compose file behaves differently...

On one machine docker-compose down seems to remove ip routes altogether that a following docker-compose up does not recreate.

Transcript:

After systemctl restart docker ip route gives:

default via 192.168.22.1 dev enp3s0 proto dhcp src 192.168.22.30 metric 202 172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown 172.18.0.0/16 dev br-b32036613f97 proto kernel scope link src 172.18.0.1 linkdown 172.20.0.0/16 dev br-3f0603a1198c proto kernel scope link src 172.20.0.1 linkdown 192.168.22.0/24 dev enp3s0 proto dhcp scope link src 192.168.22.30 metric 202 192.168.22.1 dev enp3s0 proto dhcp scope link src 192.168.22.30 metric 1024

After docker-compose up:

default via 192.168.22.1 dev enp3s0 proto dhcp src 192.168.22.30 metric 202 172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown 172.18.0.0/16 dev br-b32036613f97 proto kernel scope link src 172.18.0.1 172.20.0.0/16 dev br-3f0603a1198c proto kernel scope link src 172.20.0.1 192.168.22.0/24 dev enp3s0 proto dhcp scope link src 192.168.22.30 metric 202 192.168.22.1 dev enp3s0 proto dhcp scope link src 192.168.22.30 metric 1024

After compose-compose down the server will give:

default via 192.168.22.1 dev enp3s0 proto dhcp src 192.168.22.30 metric 202 172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown 192.168.22.0/24 dev enp3s0 proto dhcp scope link src 192.168.22.30 metric 202 192.168.22.1 dev enp3s0 proto dhcp scope link src 192.168.22.30 metric 1024

But the desktop will show (as expected):

default via 192.168.22.1 dev enp3s0 proto dhcp src 192.168.22.30 metric 202 172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown 172.18.0.0/16 dev br-b32036613f97 proto kernel scope link src 172.18.0.1 linkdown 172.20.0.0/16 dev br-3f0603a1198c proto kernel scope link src 172.20.0.1 linkdown 192.168.22.0/24 dev enp3s0 proto dhcp scope link src 192.168.22.30 metric 202 192.168.22.1 dev enp3s0 proto dhcp scope link src 192.168.22.30 metric 1024

A following docker-compose up on the desktop will succeed but on the server the routes are not recreated and the containers are not visible to the outside world...

Only a way too expensive full restart of the docker service will bring the routes back on the server...

I have no clue what I am doing wrong.

Both machines are running an up to date version of arch linux. The desktop uses Gnome and runs NetworkManager and the server is headless and runs systemd-networkd... That's pretty much the only difference I can see...

Both versions run:

  • Docker version 19.03.5-ce, build 633a0ea838
  • docker-compose version 1.25.1, build unknown

1 Answer 1

1

I was completely wrong about the origin of the problem.

I am using systemd-networkd to manage the network of this machine and I had a catch-all filter by name for the network interfaces so that eventhe docker bridges and veth were being managed by networkd.

This was of course wrong.

This was also causing the need to restart docker manually after each boot.

To solve the problem I configured systemd-networkd to ignore the interfaces managed by docker.

You can find an example of this here:

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .