

When you start Docker, a default bridge network is created automatically.
You can check this with "docker network ls".
The new containers connect to the default bridge unless otherwise specified.
You can create

Differences:

CUSTOM BRIDGE NETWORK => automatic DNS resolution between containers.
BRIDGE:
Containers can only access each other by IP addresses.
CUSTOM BRIDGE NETWORK:
Containers can resolve each other by name or alias.

Containers can only access each other by IP addresses.

Containers can resolve each other by name or alias.
CUSTOM BRIDGE NETWORK => better isolation.
BRIDGE:
Containers without a --network specified are attached to the default bridge network, so other stacks/services/containers can communicate
CUSTOM BRIDGE NETWORK:
Only containers attached to that network can communicate

Containers without a --network specified are attached to the default bridge network, so other stacks/services/containers can communicate

Only containers attached to that network can communicate
CUSTOM BRIDGE NETWORK => Containers easier to attach/detach.
BRIDGE:
To remove a container, you need to stop it and recreate it with different network options.
CUSTOM BRIDGE NETWORK:
You can attach/detach on the fly, during the lifecycle of the container.

To remove a container, you need to stop it and recreate it with different network options.

You can attach/detach on the fly, during the lifecycle of the container.
CUSTOM BRIDGE NETWORK => Specific configuration for the services.
BRIDGE:
configurable, but needs a Docker's restart and all the containers use the same settings.
CUSTOM BRIDGE NETWORK:
Created/configured using docker network create.
Custom configuration for each service.

configurable, but needs a Docker's restart and all the containers use the same settings.

Created/configured using docker network create.
Custom configuration for each service.
CUSTOM BRIDGE NETWORK => Better environment variables handling.
BRIDGE: Linked containers share environment variables.
CUSTOM BRIDGE NETWORK:
Containers connected effectively expose all ports to each other.
For a port to be accessible, that port must be published (-p flag)


Containers connected effectively expose all ports to each other.
For a port to be accessible, that port must be published (-p flag)