top | item 6708565

Docker on Raspberry Pi

111 points| petrosagg | 12 years ago |resin.io | reply

43 comments

order
[+] FooBarWidget|12 years ago|reply
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... 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|12 years ago|reply
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|12 years ago|reply
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).

[+] stock_toaster|12 years ago|reply
Not to mention, compiling a custom patched kernel.
[+] csense|12 years ago|reply
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|12 years ago|reply
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|12 years ago|reply
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|12 years ago|reply
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

[+] CSDude|12 years ago|reply
Docker, actually Linux containers uses cgroup, which only isolates and priorities the resource usages, the overhead is very very low, so it does not matter much where it is used.

The point of docker is allowing you to deploy your images, or more adequately put Dockerfiles on anywhere. So, when you have a Rpi cluster, you would worry less about deployment.

[+] Lifescape|12 years ago|reply
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

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|12 years ago|reply
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.

[+] nwh|12 years ago|reply
For the love of everything fluffy, don't run that command if you don't know what you're doing!
[+] miksago|12 years ago|reply
I've just tried to install crosstool-ng on Mac OS X 10.6.8 (i386), and building it just never works.
[+] cvlc|12 years ago|reply
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) 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) which is definitely worth a look if you're looking to network containers together.

[+] Zuph|12 years ago|reply
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|12 years ago|reply
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.
[+] rolleiflex|12 years ago|reply
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|12 years ago|reply
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|12 years ago|reply
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|12 years ago|reply
I'm looking for "the CoreOS of Raspberry Pi." Just a barebones Linux distro that just runs Docker images.

Anyone have any ideas?

[+] alexandros|12 years ago|reply
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.
[+] voltagex_|12 years ago|reply
I wonder if Docker/Go will work on uClibc; busybox + docker would make for a very small image indeed.

However, I think there are better ARM targets for Docker, but for publicity and to get the ball rolling - you can't go past the Pi.

[+] matthewmacleod|12 years ago|reply
I haven't seen anything yet, but I'm very interested in this area – I've got an application that uses a bunch of RasPi nodes, and running anything like Raspbian or even PiLFS feels too heavyweight for what I ultimately want (a single networked app that runs on startup).
[+] fredrikcarno|12 years ago|reply
Really nice work, im preparing to roll out a audio application for the pi and this could be very usefull
[+] vertis|12 years ago|reply
Looks like I know what I'll be doing with my evening.
[+] consonants|12 years ago|reply
This will make things easy to use docker on my Exynos board, last time I tried it there was no ARM compatibility.