February 2019
Intermediate to advanced
240 pages
5h 25m
English
With our newly created docker-stack.yml, we have a description of our app that Swarm can use. We’re ready to deploy our app onto our (single-node) swarm.
First, we must remember to retarget our swarm:
| | $ eval $(docker-machine env local-vm-1) |
Now we can deploy our app with the command:
| | $ docker stack deploy -c docker-stack.yml myapp |
| | Creating network myapp_default |
| | Creating service myapp_web |
| | Creating service myapp_redis |
| | Creating service myapp_database |
| | Creating service myapp_db-migrator |
This says, “Deploy the services described in docker-stack.yml as a stack called myapp.” You can see the various services being created.
We can list the services in our stack by running: