Add docker/networks/README.md

This commit is contained in:
2026-06-15 12:07:00 +00:00
parent 257105ec10
commit e842283e95
+62
View File
@@ -0,0 +1,62 @@
# Docker Networks
## Purpose
Docker networks allow containers to communicate with each other while remaining isolated from other containers and the host system.
## Networks in Use
| Network | Purpose |
| ------------------------ | ------------------------ |
| bridge | Default Docker network |
| compose-practice_default | Docker Compose nginx lab |
| gitea_default | Gitea service |
| npm_default | Nginx Proxy Manager |
| portainer_default | Portainer |
| uptime-kuma_default | Uptime Kuma |
## Observations
Each Docker Compose stack automatically creates its own network.
Examples:
| Service | Container IP |
| ------------------------ | ------------ |
| uptime-kuma | 172.17.0.2 |
| compose-practice-nginx-1 | 172.18.0.2 |
| gitea | 172.19.0.2 |
| npm | 172.20.0.2 |
| portainer | 172.21.0.2 |
## Commands
View networks:
```bash
docker network ls
```
Inspect a network:
```bash
docker network inspect NETWORK_NAME
```
Example:
```bash
docker network inspect gitea_default
```
## Lessons Learned
* Every Compose stack gets its own network.
* Containers communicate using private Docker IP addresses.
* Containers on separate networks cannot automatically communicate with each other.
* Docker networks provide isolation and security.
* Reverse proxies often require containers to share a network.
## Date Created
June 15, 2026