Skip to main content

Setup Docker on Raspberry Pi

·266 words·2 mins
tech alpine busybox containers debian docker iot linux raspberry-pi raspbian technology
James Pettigrove
Author
James Pettigrove
Cloud Engineer with a focus on Microsoft Azure

With the 1.12.1 release, Docker is now officially supported on the Raspberry Pi. Hooray!

I personally love containers for the ability to build once, run many across a multitude of different operating systems and one day, even architectures. Because I am a bit of a neat freak, it also is very beneficial that Docker helps keep applications from spreading their dirt all over the host’s filesystem (OpenVPN is a classic for this).

With that said, how do we get Docker? Very simply.

At your shell prompt, enter the below:

curl -sSL get.docker.com | sh

Once it has been downloaded and unpacked from the repos it will present you with the Docker version and a few handy tips we will go into in a moment:

Before we go any further, let’s add it the daemon that manages the Docker infrastructure as a auto starting service and kick it off:

sudo systemctl enable docker && sudo systemctl start docker

We can verify the service been added and successfully started by dropping the following code:

systemctl status docker

You should be presented with something similar to the below with happy green text telling us all is good:

Now you are all ready to go but Docker will require elevating with sudo unless you add your user (usually pi on a Raspberry Pi) to the Docker security group with the below:

sudo usermod -aG docker pi

Make sure you reset your TTY session otherwise you will get permission denied errors for not elevating

Now what? In my next post we will run a basic image inside a container. Stay tuned!

Related

Predictable failure - Tweeting with Python Part 2
·320 words·2 mins
tech debian iot linux python raspberry-pi raspbian technology twitter twython
Part 1 of the series saw us signing up to Twitter and getting access to the API to send tweets, setting up Twython and developing out shutdown script.
Predictable failure - Tweeting with Python Part 1
·867 words·5 mins
tech bitcoin cryptocurrency debian iot linux python raspberry-pi raspbian technology twitter twython
As explained in a previous series of mine, I run a small Bitcoin mining operation on my Raspberry Pi.
Mining Bitcoins with Raspberry Pi - Part 3
·405 words·2 mins
tech bitcoin cgminer cryptocurrency debian iot linux raspberry-pi raspbian technology
Continuing on from the good work we have achieved thus far in Part 1 & Part 2, we are going to complete our Bitcoin Mining journey by making our Raspberry Pi start mining as soon as it is powered on.