Docker for Rails Developers - 'docker-machine' command deprecated (page 156)

Docker-Machine became part of the Docker Toolbox, which was deprecated in 2020, long after Docker Desktop supported Docker Engine natively for Mac and Windows. It was only being maintained to support Windows 7 and 8 users.

Page 156 includes this docker-machine command:

docker-machine create --driver virtualbox local-vm-1

Many other commands follow in this chapter which rely on docker-machine.

To help anyone else wanting to learn how to use Docker Swarm on a local cluster, I’ve created local-docker to aid in the setup of local VMs within Virtualbox, using Vagrant + Ansible.

Note: I just realized that deploying to Vagrant machines is not necessary, you can use docker swarm and docker stack commands locally against your local Docker Desktop engine. This might actually be preferred because Docker Desktop allows you to visualize and manage those containers/services from the Docker Desktop GUI interface.

I only recommend using my ‘local-docker’ setup if you want to see how it is to deploy to multiple Docker Engine servers simultaneously. You will need to setup another context using docker context and select to use it to manage the Vagrant swarm cluster, or even a remote swarm cluster.