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.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🟨" title="Gelbes Quadrat" aria-label="Emoji: Gelbes Quadrat">BRIDGE:
Containers can only access each other by IP addresses.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="✅" title="Fettes weißes Häkchen" aria-label="Emoji: Fettes weißes Häkchen">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.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🟨" title="Gelbes Quadrat" aria-label="Emoji: Gelbes Quadrat">BRIDGE:
Containers without a --network specified are attached to the default bridge network, so other stacks/services/containers can communicate
https://abs.twimg.com/emoji/v2/... draggable="false" alt="✅" title="Fettes weißes Häkchen" aria-label="Emoji: Fettes weißes Häkchen">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.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🟨" title="Gelbes Quadrat" aria-label="Emoji: Gelbes Quadrat">BRIDGE:
To remove a container, you need to stop it and recreate it with different network options.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="✅" title="Fettes weißes Häkchen" aria-label="Emoji: Fettes weißes Häkchen">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.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🟨" title="Gelbes Quadrat" aria-label="Emoji: Gelbes Quadrat">BRIDGE:
configurable, but needs a Docker& #39;s restart and all the containers use the same settings.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="✅" title="Fettes weißes Häkchen" aria-label="Emoji: Fettes weißes Häkchen">CUSTOM BRIDGE NETWORK:
Created/configured using docker network create.
Custom configuration for each service.
configurable, but needs a Docker& #39;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.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="🟨" title="Gelbes Quadrat" aria-label="Emoji: Gelbes Quadrat">BRIDGE: Linked containers share environment variables.
https://abs.twimg.com/emoji/v2/... draggable="false" alt="✅" title="Fettes weißes Häkchen" aria-label="Emoji: Fettes weißes Häkchen">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)