Docker for Your Pocket
What do you do when you like tinkering around with docker and have an old Raspberry Pi lying around?
Yup, you bring those two together and make a docker host out of the RPi with docker-machine, docker-compose and all that nice stuff.
Remember, I love the idea of docker-compose and being able to abstract away applications and simple commands in a docker image and not having to worry about an underlying host.
Enter Hypriot.
A bunch of clever people already made up their minds to run docker on an RPi, you can find them here.
They provide ready-made images for being used on an RPi.
It was my first time playing around with a machine like that and it took me around 20 minutes to get it running.
I have just followed their “Getting started guide”, with only one difference: I have used their latest image as described in this article.
Without much explanation I will just provide the commands how I have used them. Not much of a difference to their guide.
diskutil list
diskutil unmountdisk /dev/disk2
sudo dd if=hypriot-rpi-20151115-132854.img of=/dev/rdisk2 bs=1m
diskutil unmountdisk /dev/disk2
After that I have inserted the card into the RPi, attached a screen and a keyboard and started it up by plugging in the power cord. Logged in once to find my IP address and then connected with SSH from my Mac to start up the container. Then I could remove the screen cable and the keyboard again. I like a clean desk. Am known for it.
ssh [email protected]
docker run -d -p 80:80 hypriot/rpi-busybox-httpd
Uuups, ran into a little problem here …
HypriotOS: root@black-pearl in ~ $ docker run -d -p 80:80 hypriot/rpi-busybox-httpd Unable to find image 'hypriot/rpi-busybox-httpd:latest' locally Pulling repository docker.io/hypriot/rpi-busybox-httpd Error while pulling image: Get https://index.docker.io/v1/repositories/hypriot/rpi-busybox-httpd/images: x509: certificate has expired or is not yet valid
Found the answer by searching the hypriot channel on gitter.
Fixed that little issue with date -s "19 NOV 2015 23:24:00"
and started up the container again.
docker run -d -p 80:80 hypriot/rpi-busybox-httpd
On my Mac I have pointed my browser to 192.168.178.10
and saw a nice welcome screen:
Cool, I have the hammer, now I just need a nail …
Done for today!