DELAPARRA
Index
Color
NL
Category: Docker

bridge

Explained by Updated

What is bridge?

bridge: The default network driver. Containers get a private IP on a virtual bridge and reach the outside world via NAT. Bridge is Docker's default network driver. Each container gets a private IP address on a virtual network inside the host, and reaches the internet through network address translation. Containers on the same user-defined bridge network can reach each other by container name. Your app can connect to mysql:3306 instead of an IP address. Docker Compose creates such a network for every project automatically.

Definition source Coders Lingo, CC BY 4.0

Frequently asked questions about bridge

What should you keep in mind with bridge?

The built-in default bridge does not offer name resolution, which is why docker network create and Compose networks are the better choice. To make a service reachable from outside the host, publish its port with -p. Only publish what needs to be public. A database usually only needs to be reachable from the app container, not from the whole internet.

What does an example of bridge look like?

docker network create --driver bridge appnet docker run --network appnet myapp:1.0

At a glance

CategoryDocker
Explained by
Updated

More Docker terms

All terms starting with B

Skills

Download all skills (zip)

Manuals

Related services

Need any help?

Stuck on one of these in your own project? Tell me what you are working on and I will tell you how I would approach it.