Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
"Deploying Multi-OS Applications with Docker Swarm" with Docker's David Yu
1. Vegas Meetup - Deploying Multi-
OS Applications with Docker
Swarm
David Yu - david.yu@docker.com
Before we get started you will need:
● RDP client
● SSH client
2. • Build a swarm cluster
− Linux manager
− Windows worker
• Deploy a OS-specific tweet web app to both nodes
• Deploy a simple two service app
− Java-based web front end running on Linux
− SQL server based database on Windows
Clustering and container scheduling
2
What will we be doing today?
9. 9
Configuring RDP Client
WiFi Info:
vz-guest
User: vz9933
PN: 58432
Before we get started you will need:
• RDP client
• SSH client
Lab Guide:
https://github.com/mikegcoleman/hybrid-workshop
11. Services Tasks
• Services provide a piece of functionality
• Based on a Docker image
• An application is made up of 1-n services
• Replicated Services and Global Services
• Tasks are the containers that actually do the work
• A service has 1-n tasks
12. How service deployment works
$ docker service create declares
the service name, network, image:tag
and scale
Managers break down service into
tasks, schedules them and
workers execute tasks
Engines check to see what is running
and compared to what was declared
to “true up” the environment
Declare
ScheduleReconcile
16. Engine
Engine
Engine
Engine
Engine
Desired State ≠ Actual State
$ docker service create --replicas 3 --name frontend --network mynet
--publish 80:80/tcp frontend_image:latest
$ docker service create --name redis --network mynet redis:latest
mynet
17. Engine
Engine
Engine
Engine
Engine
Converge Back to Desired State
$ docker service create --replicas 3 --name frontend --network mynet
--publish 80:80/tcp frontend_image:latest
$ docker service create --name redis --network mynet redis:latest
mynet
18. Labels
• Docker uses labels to manage metadata on objects
• Many objects already have labels / metadata
• Docker allows arbitrary assignment of labels
• Filter on labels: docker ps --filter "label=color"
• Schedule based on labels (--constraint)
20. Docker Compose: Multi Container Applications
20
Without Compose
• Build and run one container at a time
• Manually connect containers together
• Must be careful with dependencies and start
up order
With Compose
• Define multi container app in compose.yml file
• Single command to deploy entire app
• Handles container dependencies
• Works with Docker Swarm, Networking,
Volumes, Universal Control Plane
22. Stacks: Multi-Container Applications
●A stack is a collection of related services
○ Requires Swarm
●Stacks are a Docker primitive
○ docker stack deploy
○ docker stack ps
○ docker stack rm
●Implemented via a docker compose file
22