Search code examples
dockerdocker-composedocker-network

Docker virtual network interfaces are mandatory


Docker fill my network manager with many network interfaces that i think are unnecessary.

unnecessary network interfaces

My simply project have 4 container and 1 network.

Why i need this long list of network interfaces?

I expect to have just a single networks interfaces for every project, not for every container. Right?


Solution

  • Each container lives in it's own name space, seperate and cut off from the host and other containers. If you run 5 containers, by default you will have 5 veth interfaces so each container can communicate outside it's own name space.

    The Docker "network" creates 1 bridge, which all the veth interfaces are connected to.

    If you don't need IP communication from a container you can run it with --net=none.

    You could also share/mount a socket file between containers to allow unix socket communication without the interface.