Setting up a Swarm cluster with Docker Machine and DigitalOcean API

We'll continue using the vfarcic/cloud-provisioning (https://github.com/vfarcic/cloud-provisioning) repository. It contains configurations and scripts that'll help us out. You already have it cloned. To be on the safe side, we'll pull the latest version:

cd cloud-provisioninggit pull

Let's create the first droplet:

docker-machine create \    --driver digitalocean  \    --digitalocean-size 1gb  \    --digitalocean-private-networking \      swarm-1

We specified that the Docker Machine should use the digitalocean driver to create an instance in the region we defined as the environment variable DIGITALOCEAN_REGION. The size of the droplet is 1 GB and it has private networking enabled.

Get The DevOps 2.1 Toolkit: Docker Swarm now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.