When DockerDocker
Docker is a [[Container Engine]] that helps people easily develop and ship their applications.
This note serves as a link to connect Docker-related notes.
[[Docker Networking]]
Status: #🌲 ... is installed, it creates an internal private network which is by default called bridge
. You can see this network like this:
docker network ls
#> NETWORK ID NAME DRIVER SCOPE
#> 71f0f1f94055 bridge bridge local
While docker refers to this network as bridge
, to the host this network is visible as docker0
:
ip link
#> ...
#> 4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN mode DEFAULT group default
Docker accomplishes this by creating a Linux Bridge like so:
ip link add docker0 type bridge
Linux Bridge, while acting like a Network SwitchNetwork Switch
In [[Linux Networking]], the most basic form of a network is two PCs connected with a switch.
In order for machines to connect to a switch, we need an interface on each host (these can be physical... to the 01 Inbox/Network Namespaces, it acts as an interface to the host. Therefore the interface docker0
on the host is assigned an IP address.
ip addr
#> ...
#> 4: docker0: ...172.17.0.1 ...
#> ...
Once this is set up, every time container is created with --network bridge
, Docker attaches it to this bridge. See Docker Container Network SetupDocker Container Network Setup
Whenever a container is created, [[Docker]] creates a [[01 Inbox/Network Namespaces]] for it.
You wont be able to see it when running ip netns because Docker doesn't create a symlink for it. Let's... for more details.
Status: #💡