Over a million developers have joined DZone.

Docker Swarm Node Set Up with Docker 1.12 RC on Raspberry Pi (Part 1)

Kevin Hooke's part 1 gives quick tips to get Docker up and running.

· Cloud Zone

Build fast, scale big with MongoDB Atlas, a hosted service for the leading NoSQL database on AWS. Try it now! Brought to you in partnership with MongoDB.

I've been following the steps in this article to set up a Docker swarm cluster on a pair of Raspberry Pis. Most of the steps work as-is from Mac OS, but for a few steps, there are a couple of variations.

This is most likely going to be part 1 of a few posts as I work through and get this working.

For example, to copy your SSH key to the Pis, instead of:

ssh-copy-id pirate@pi3.local

… you can do (from tip here):

cat ~/.ssh/id_rsa.pub | ssh user@machine "mkdir ~/.ssh; cat >> ~/.ssh/authorized_keys"

To switch between remote hosts, type...

eval $(docker-machine env pi1)

where pi1 is the name of the remote host.

To switch back to the localhost (not entirely obvious but found the answer here):

eval "$(docker-machine env -u)"

After 'swarm init' and adding the other nodes to the cluster, 'docker swarm ls' lists the nodes in the cluster:

More to come in part 2.

Now it's easier than ever to get started with MongoDB, the database that allows startups and enterprises alike to rapidly build planet-scale apps. Introducing MongoDB Atlas, the official hosted service for the database on AWS. Try it now! Brought to you in partnership with MongoDB.

docker,raspberry pi,cluster

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}