Professional Documents
Culture Documents
Docker Swarm
Docker Swarm
● Swarm cluster
● Service & tasks
● Ingress overlay network
● Internal overlay network
● Stack
Swarm cluster
Standalone host Swarm cluster
Cont Cont
Cont Cont Cont Cont Cont
Cont Cont
Docker
Manager & worker nodes
Task #1: Tạo Swarm cluster
Các bước tiến hành
● App được triển khai theo từng ● App được triển khai dưới dạng
container service
● Mỗi app là 1 contaner chạy ● Mỗi app có thể là nhiều task
trên 1 node (container) chạy trên nhiều node
● docker run … image ● docker service create … image
Standalone container Swarm service
Nginx Container
Task #2: Triển khai 1 service
chạy image Nginx trên
Swarm cluster
Các bước tiến hành
● Trên node manager: Sử dụng docker service create với image nginx,
expose ra cổng 8080, đặt tên service là nginx-app
● Kiểm tra xem service đang chạy ở node nào:
docker service ps nginx-app
● Gọi vào cổng 8080 từ một node bất kỳ trong Swarm
Task #3: Triển khai service
chạy image jwilder/whoami
gồm 5 tasks
Các bước tiến hành