Quick Recap

Let's review what we have covered in this chapter.

Highlights

Another action-packed chapter. You have now learned the major tools in our belt for deploying apps with Docker. Let’s review what we covered in this chapter:

  1. We introduced Docker Machine and used it to create a virtualized Docker-ready instance:

    $ docker-machine create --driver virtualbox local-vm-1
    
  2. We logged onto the new instance using SSH:

    $ docker-machine ssh local-vm-1
    

    We also issued commands against it from our local shell session:

    $ docker-machine ssh <instance name> "<command>"
    
  3. We saw how to configure our Docker Client to target the Docker Engine on our virtual instance:

    $ eval $(docker-machine env local-vm-1)
    

    and to reset it again with:

    $ eval $(docker-machine env -u)
    
  4. We turned our vanilla Docker instance into a single-node swarm cluster:

    $ docker swarm init --advertise-addr <IP address of instance>
    
  5. Having created a production version of our docker-compose.yml called docker-stack.yml, we deployed our application on the swarm as a stack using:

    $ docker stack deploy -c docker-stack.yml myapp
    
  6. We saw how to list the services in our stack with:

    $ docker stack services myapp
    

    or list all services on the swarm with:

    $ docker service ls
    
  7. We saw how to deploy an updated version of the app:

    $ docker stack deploy -c docker-stack.yml myapp
    
  8. We scaled up our web service by running multiple containers, utilizing Swarm’s built-in load balancing:

    $ docker service scale myapp_web=<n>
    

What to expect in the next chapter?

Now that we have started to get a feel for Docker Machine and Swarm, and have seen how to deploy and scale our application, it is time to move onto the big leagues. In the next chapter, we will finally move off our local machine and into the big, wide world that is the cloud.

Get hands-on with 1200+ tech skills courses.