How network works in docker-compose?
docker-compose creates a set of containers, brings them up along with a private network. The network is very interesting because a private network is essential to compose & test a microservice bases system.
I found the post https://medium.com/@caysever/docker-compose-network-b86e424fad82 quite useful.
docker-composecreates a default network, if no network is specified.
- The name of the network is
- The default network type is
A bridge is a layer 2 component. It understands segments and uses a hardware/software switch/bridge.
Use the host network namespace. It is preferred for achieving high performance. It works on Linux only.