

Docker on Raspberry Pi - petrosagg
http://resin.io/docker-on-raspberry-pi/

======
FooBarWidget
Docker awesome. Anybody who wants to play around it with can do so easily with
the Docker-friendly Vagrant boxes that I've built.
[http://blog.phusion.nl/2013/11/08/docker-friendly-vagrant-
bo...](http://blog.phusion.nl/2013/11/08/docker-friendly-vagrant-boxes/) It
used to be a minor pain to provision to Vagrant of the system reboot required
to replace the kernel, but these boxes have already done that part for you.

Docker still has some bugs though. I hope they'll fix them quickly.

------
dstaley
Correct me if I'm wrong, but couldn't you just make an image of the SD card
and distribute that, as opposed to having people go through 88 (I counted)
steps?

~~~
fragmede
And they're not trivial steps either.

Install Arch Linux? Resize the root partition? Patch and build the kernel?
Bootstrap and rebuild Docker?

I'm all for an easier Internet of things, but this ain't it (yet).

~~~
petrosagg
You're right, the instructions are a lot and not trivial but are very useful
for the Docker team and hackers that may want to modify the procedure. We are
planning to release pre-built binaries and kernel soon though.

~~~
yebyen
If you want to maintain the idea that RPI is for hobbyists, you should not
make it too easy, since these are all things that normal hobbyists used to do,
until it became unnecessary.

If nothing else, make sure there is still a dockerfile (for parts where direct
access to hardware are not needed, like you would never write a dockerfile
that resized the OS partition since that happens outside) and always current
up-to-date manual instructions! Thanks for the great work!

I am looking forward to CoreOS on RPI, if that's planned to be a thing! It
would be a good reason to buy a bigger SD card, for me.

------
csense
If their focus is on the Internet of Things and hardware applications enabled
by the Pi, their next focus should be creating or linking to documentation
about how to expose hardware interfaces like the Pi's GPIO to guests.

Of course a higher priority should be cleaning up the process in this article,
making the install simpler, getting precompiled kernels/images out there,
getting it to work with Raspbian host.

~~~
alexandros
Thanks for the feedback. Hopefully the instructions in the article will be
helpful to the docker team first and foremost, and adventurous hackers
possibly. The hope is that this will become part of official docker, not that
people will have to repeat a 100+ step process.

As a side note, getting this working on Raspbian should be feasible (consider
it an exercise for the reader), we just used Arch as we've focused on that for
a bunch of other things.

------
alexandros
Happy to have this out there. We worked quite hard on this the past few weeks,
hopefully it will help people see the benefit of Docker for the embedded world
as they have seen it on the server side.

------
atmosx
A couple of naive questions:

Isn't more expensive to run docker upon Linux and deploy your applications
instead of installing the applications and it's dependencies directly on the
Pi?

How is this going to work on underpowered machines such as the RPi?

Is it for applications that require a very small amount of memory? (say you
can run 5 applications that consume 80 MB each?).

Maybe I erroneously tie-up Docker with web-development and web-based
applications, but can you give an couple of example applications that could
benefit from docker on the Pi?

thanks

~~~
alexandros
Thanks for the excellent questions. I started writing a response but it became
way too long, so I moved it to the blog:

[http://resin.io/blog/why-port-docker-to-the-raspberry-
pi/](http://resin.io/blog/why-port-docker-to-the-raspberry-pi/)

~~~
atmosx
Thank you alexandros for the prompt reply. I will read the blog post tonight
at home.

ps. You're Greek?

~~~
alexandros
Yup :) The team is split between the UK and Athens.

------
Lifescape
If anyone is on a Mac trying to write the Arch image to an SD card, follow the
steps on this site to find your SD card:
[http://www.embeddedarm.com/support/faqs.php?item=10](http://www.embeddedarm.com/support/faqs.php?item=10)

The command for me was: _sudo dd if=$RPIDIR /archlinux-hf-2013-07-22.img
of=/dev/disk1 bs=4m_

It also took about 20 minutes to write.

~~~
miksago
Yeah, I'm working on updated instructions at the moment. You may get stuck at
the step that's "Install a new kernel on the RPi." if your system is i386;
Those instructions only work on x86_64, afaik.

I'm keeping a log of what I try to see if I can make things faster / better.

~~~
Lifescape
Yep, got stuck on that step :P

Decided to go with an Arch Vagrant box (Specifically _Arch Linux x86_64
(2013-08)_ from [http://www.vagrantbox.es/](http://www.vagrantbox.es/)).
Running into issues with _make_ in Step 5:

 _drivers /thermal/bcm2835-thermal.c:21:23: fatal error: mach/vcio.h: No such
file or directory_

Has anyone here run into this issue?

------
cvlc
I, too, had the idea of utilizing Docker in the IoT - in fact, I chose that as
the focus of my MSc dissertation (though my primary goal was to implement
automated docker/LXC container provisioning for resources on a server to be
utilized by a sensor device). I created a little open-source tool called
Orchestrator
([https://github.com/cvlc/orchestrator](https://github.com/cvlc/orchestrator))
to automatically provision docker instances on a remote server in response to
DHCPv6 requests. Unfortunately, I've been side-tracked on other projects for a
while and haven't really got the ball rolling yet - I'll be looking to update
it fairly soon, though!

Jérôme Petazzoni (employee of Docker, formerly dotcloud) has created an
excellent (I'd say essential) tool for dealing with networks under Docker
called Pipework
([https://github.com/jpetazzo/pipework](https://github.com/jpetazzo/pipework))
which is definitely worth a look if you're looking to network containers
together.

------
Zuph
I come from an Electrical Engineering/Low-level embedded background. I only
just learned of Docker/Vagrant/et al., and although I can understand the
utility in _some_ contexts, I can't possibly understand the utility of running
Docker on a Raspberry Pi (except as a toy exercise). What am I missing?

~~~
timClicks
Very easy deployment. A Dockerfile that works on your desktop that refers to a
container image can be very easily be sent to many devices and installed
seamlessly.

~~~
Zuph
Even if those two devices have radically different architectures?

------
rolleiflex
Very nice. Even if just for marketing I think this is going to pay for itself.
Many people have Raspberry Pi's lying around, semi-useless. Working on this
gives me a nice a weekend-night project I can try without fear of borking
something critical on my other devices, plus a new thing to play with is
always welcome.

------
singular
Awakening from a nap to see something you worked on #1 on hacker news is quite
nice :-) hope people get a kick out of this!

------
slaxman
This is brilliant. This means writing software that interfaces with real world
physical items is going to get much simpler, quicker and more efficient.
Awesome work.

------
TheMakeA
I'm looking for "the CoreOS of Raspberry Pi." Just a barebones Linux distro
that just runs Docker images.

Anyone have any ideas?

~~~
alexandros
If anyone gets that done it will make us very happy! We run our servers on
CoreOS, putting it on the devices as well would be awesome. AFAICT it's about
getting etcd to run on the Pi, as well as any other small projects that make
up CoreOS.

~~~
shykes
There is an ongoing project to bundle Docker with Tiny core linux, which is
even more lightweight than coreos. Meanwhile there is also work to add
clustering capabilities to docker.

~~~
alexandros
Awesome stuff.. any pointers to where this work is getting done?

~~~
shykes
Most of the action is on the #docker irc channel on Freenode.

------
fredrikcarno
Really nice work, im preparing to roll out a audio application for the pi and
this could be very usefull

~~~
doelie_
Link?

------
vertis
Looks like I know what I'll be doing with my evening.

------
overdrev
Nice.

------
consonants
This will make things easy to use docker on my Exynos board, last time I tried
it there was no ARM compatibility.

