Hacker News new | past | comments | ask | show | jobs | submit login
Docker on Raspberry Pi (resin.io)
111 points by petrosagg on Nov 10, 2013 | hide | past | favorite | 43 comments



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.


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?


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).


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.


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.


Not to mention, compiling a custom patched kernel.


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.


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.


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.


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


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/


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

ps. You're Greek?


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


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.


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.


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.


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.


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/). 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?


For the love of everything fluffy, don't run that command if you don't know what you're doing!


If you don't know what dd does, never run it. You really should know what all commands do, but dd can hose your system very easily.


I've just tried to install crosstool-ng on Mac OS X 10.6.8 (i386), and building it just never works.


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?


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.


Even if those two devices have radically different architectures?


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.


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!


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.


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

Anyone have any ideas?


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.


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.


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


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


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.


Docker is compiled statically so will definitely work on busybox :)


This is really interesting for Docker - the friction to get started on the Pi is even lower: just swap in a new SD card and Go.

(edited for unintentional pun.)


I looked for something like this myself - the closest I think you could get for now is a bespoke, stripped-down Gentoo with Docker. That said, there's a conversation taking place on the CoreOS mailing list that looks promising (https://groups.google.com/forum/#!topic/coreos-dev/cioNy0GjC...).


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).


Hi Matthew, I'm interested in how you're dealing with code deployment. Have an email address in profile if you want to talk.


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


Link?


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


Nice.


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: