https://abs.twimg.com/emoji/v2/... draggable="false" alt="🐳" title="Wasserspeiender Wal" aria-label="Emoji: Wasserspeiender Wal">BRIDGE NETWORKShttps://abs.twimg.com/emoji/v2/... draggable="false" alt="🟨" title="Gelbes Quadrat" aria-label="Emoji: Gelbes Quadrat">

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 https://abs.twimg.com/emoji/v2/... draggable="false" alt="✅" title="Fettes weißes Häkchen" aria-label="Emoji: Fettes weißes Häkchen">a CUSTOM BRIDGE NETWORK.

Differences:https://abs.twimg.com/emoji/v2/... draggable="false" alt="👇" title="Rückhand Zeigefinger nach unten" aria-label="Emoji: Rückhand Zeigefinger nach unten">
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.
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
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.
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.
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)
You can follow @FrancescoCiull4.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: