🐳BRIDGE NETWORKS🟨

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 ✅a CUSTOM BRIDGE NETWORK.

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.
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
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.
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.
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)
You can follow @FrancescoCiull4.
Tip: mention @twtextapp on a Twitter thread with the keyword “unroll” to get a link to it.

Latest Threads Unrolled: