![image](https://private-user-images.githubusercontent.com/87309910/304601299-878eaf6a-18bc-4467-8b3f-5086de8ff3a1.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjYwMTgxNjAsIm5iZiI6MTcyNjAxNzg2MCwicGF0aCI6Ii84NzMwOTkxMC8zMDQ2MDEyOTktODc4ZWFmNmEtMThiYy00NDY3LThiM2YtNTA4NmRlOGZmM2ExLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA5MTElMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwOTExVDAxMjQyMFomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWRiMzhmYWE4MGJiMTdjNjM1YjAyYTVmMjQzZDMzMTJjODkyZGQ3MjgwYjQzOTkwZmFhNzNhZTg3MGZlYmVmOTQmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.PnhuEzVX-t_1wWuPDPPzCGlSuxLljsXsluV9VtimHsU)
$ sudo docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
$ sudo docker ps -a
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
$ docker run -itd -p 8002:80 --name serv-a nginx
$ docker run -itd -p 8003:80 --name serv-b nginx
$ docker run -itd -p 8001:80 --name lb nginx:latest
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2fe6b3ebdb6e nginx "/docker-entrypoint.…" 5 seconds ago Up 4 seconds 0.0.0.0:8002->80/tcp, :::8002->80/tcp serv-a
fafba17b8cf6 nginx "/docker-entrypoint.…" 18 seconds ago Up 17 seconds 0.0.0.0:8003->80/tcp, :::8003->80/tcp serv-b
fd3ca54a154a nginx:latest "/docker-entrypoint.…" 3 minutes ago Up 3 minutes 0.0.0.0:8001->80/tcp, :::8001->80/tcp lb
$ sudo docker network ls
$ sudo docker network create abc
$ sudo docker network connect abc serv-a
$ sudo docker network connect abc serv-b
$ sudo docker network connect abc serv-c
$ tree
.
├── README.md
├── lb
│ ├── Dockerfile
│ └── config
│ └── default.conf
├── serv-a
│ ├── Dockerfile
│ └── index.html
└── serv-b
├── Dockerfile
└── index.html
$ cd lb
$ sudo docker build -t pysatellite/lb:0.1.0 .
$ sudo docker push pysatellite/lb:0.1.0
$ cd ../serv-a
$ sudo docker build -t pysatellite/serv-a:0.1.0 .
$ sudo docker push pysatellite/serv-a:0.1.0
$ cd ../serv-b
$ sudo docker build -t pysatellite/serv-b:0.1.0 .
$ sudo docker push pysatellite/serv-b:0.1.0
$ sudo docker network create -d bridge lb-net
$ sudo docker run -d --name serv-a --network lb-net pysatellite/serv-a:0.1.0
$ sudo docker run -d --name serv-b --network lb-net pysatellite/serv-b:0.1.0
$ sudo docker run -d -p 8001:80 --name lb --network lb-net pysatellite/lb:0.1.0
$ sudo docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
d86886fc9d9e pysatellite/lb:0.1.0 "/docker-entrypoint.…" 3 seconds ago Up 2 seconds 0.0.0.0:8001->80/tcp, :::8001->80/tcp lb
e4444ea35c22 pysatellite/serv-b:0.1.0 "/docker-entrypoint.…" About a minute ago Up About a minute 80/tcp serv-b
dd8af81cafb7 pysatellite/serv-a:0.1.0 "/docker-entrypoint.…" About a minute ago Up About a minute 80/tcp serv-a
$ curl http://localhost:8001
<h1>A</h1>
$ curl http://localhost:8001
<h1>B</h1>
$ curl http://localhost:8001
<h1>A</h1>