24

How would I go about running Docker (https://www.docker.io) on Raspbian?

The instructions I've found are either a very manual process based on Raspbian but with a very old kernel that seemed to require a bunch of patches. There's also the well-known build by the resin.io folks, but it's specifically made for Arch Linux.

Current Raspbian kernel is 3.10.25 which is modern enough to have most of the stuff that Docker needs. I'm not above building a new kernel, but is that still necessary?

Has anyone figured out how to get Docker and its requirements going on the Pi?

goldilocks
  • 60,325
  • 17
  • 117
  • 234
Martijn Heemels
  • 428
  • 1
  • 4
  • 7

5 Answers5

14

Yes, I have built a kernel and ported Docker 1.0 to the Raspbian OS: Linux raspberrypi 3.10.37+ #1 PREEMPT Sat Apr 19 13:28:05 UTC 2014 armv6l GNU/Linux

I have shared my outputs on GitHub to save others the pain. As is usual I have provided this 'as-is' with no warranty ;-)

You can find the kernel & docker tar file here:

https://github.com/stevef1uk/docker_for_rpi

Seahope
  • 156
  • 1
  • 3
7

You can also use HypriotOS, which provides the latest Docker and Linux kernel for Raspberry Pi. Just flash the image and see Docker up and running!

http://blog.hypriot.com/

(disclosure: I am a team member of Hypriot)

3

If you use Raspbian:

sudo apt-get update
sudo apt-get dist-upgrade
sudo apt-get install docker.io docker

Docker is now in the default repository,

Update: unfortunately this version is quite old, so pulling in images from Docker Hub won't work at the moment.

Janghou
  • 1,446
  • 1
  • 16
  • 20
3

Docker supports ARMv6/v7 and even ARM64 (v8?), so you can run it on your Raspberry Pis.

Follow the official instructions from Docker here: https://docs.docker.com/engine/installation/linux/docker-ce/debian/

If you have Raspbian Jessie or Stretch (check the above documentation for others), this would be:

$ sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
$ curl -fsSL https://download.docker.com/linux/$(. /etc/os-release; echo "$ID")/gpg | sudo apt-key add -
$ echo "deb [arch=armhf] https://download.docker.com/linux/$(. /etc/os-release; echo "$ID") \
     $(lsb_release -cs) stable" | \
     sudo tee /etc/apt/sources.list.d/docker.list
$ sudo apt-get update; sudo apt-get install docker-ce
$ sudo systemctl start docker

You can then test it (thanks to Docker multiarch support):

$ sudo docker run --rm hello-world

In order to avoid typing sudo for every Docker invocation, you can do the following extra steps: https://docs.docker.com/engine/installation/linux/linux-postinstall/

Enjoy!

PS: I've installed Ubuntu Server 16.04 for armhf. I have then followed these instructions (for Ubuntu) to install Docker on it: https://docs.docker.com/engine/installation/linux/docker-ce/ubuntu/#set-up-the-repository. It works like a charm as well.

Huygens
  • 733
  • 5
  • 12
2

I have always used...

curl -sSL https://get.docker.com | sh && sudo usermod -aG docker pi

However, I just saw a deprecation notice this morning...

WARNING: raspbian is no longer updated @ https://get.docker.com/
         Installing the legacy docker-engine package...
Zak
  • 141
  • 5