Has anyone managed to get docker running on OSMC on the Raspi?

I installed the latest OSMC today (2015-08-01) and installed the docker-hypriot debian package … with fingers crossed.
(http://downloads.hypriot.com/docker-hypriot_1.8.1-1_armhf.deb)

However when starting the Docker daemon with the command:
sudo /usr/bin/docker -d=true -p /var/run/docker.pid --storage-driver=overlay -D

it’s failing, with the following message
DEBU[0000] [graphdriver] trying provided driver “overlay”
ERRO[0000] ‘overlay’ not found as a supported filesystem on this host. Please ensure kernel is new enough and has overlay support loaded.
FATA[0000] Error starting daemon: error initializing graphdriver: driver not supported

So alternatively I tried with the devicemapper driver but got the following error:
DEBU[0000] [graphdriver] trying provided driver “devicemapper”
DEBU[0000] docker group found. gid: 113
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
DEBU[0000] devicemapper: driver version is 4.31.0
DEBU[0000] Generated prefix: docker-179:2-2123
DEBU[0000] Checking for existence of the pool ‘docker-179:2-2123-pool’
DEBU[0000] Pool doesn’t exist. Creating it.
FATA[0000] Error starting daemon: error initializing graphdriver: Error running DeviceCreate (CreatePool) dm_task_run failed

Any suggestions as to what I could try?

Is it worth copying the kernel from a hypriot-debian jessie system (which runs docker no problem) ?
If so is it sufficient to just replace /boot/kernel.img ?

Thanks for any pointers.

We probably need to make some kernel changes. I believe this was added to the mainline Pi kernel already. I’m happy to add these changes as they don’t seem to impact performance

Sam

1 Like

Thanks Sam,

If I can help as a tester on rpi2, just let me know …

This would be a killer feature for me
(my Raspberries have been a bit under utilised recently as I’ve been using them just with the Hypriot Docker images),

if I could get OSMC and Docker then this would allow my Raspberries to satisfy my 3 main needs of them.

Hi

I have added support for Docker and this will be available in the September update

Sam

Hi Sam,

Thanks your work, I could install docker-hypriot_1.8.2-1_armhf.deb which downloaded from http://blog.hypriot.com/ after upgrade to OSMC to 2015.09-1

kernel version is the newest:
osmc@osmc:~$ uname -a
Linux osmc 4.2.1-1-osmc #1 SMP PREEMPT Wed Sep 23 17:57:49 UTC 2015 armv7l GNU/Linux

But when I pull an image and try to run docker container, it showed error like belows:

osmc@osmc:~$ sudo docker run -t -i ubuntu /bin/bash
WARNING: Your kernel does not support memory swappiness capabilities, memory swappiness discarded.
exec format error
Error response from daemon: Cannot start container 6c022535d54d1ce864adea05cd5071724cc58e325ebd06646f349e3d490bbe49: [8] System error: exec format error
osmc@osmc:~$

And docker debug message showed kernel doesn’t support cgroup & memory swappiness capabilities:

osmc@osmc:~$ sudo docker -d
Warning: ‘-d’ is deprecated, it will be removed soon. See usage.
WARN[0000] please use ‘docker daemon’ instead.
INFO[0000] [graphdriver] using prior storage driver “overlay”
INFO[0000] Listening for HTTP on unix (/var/run/docker.sock)
INFO[0000] Option DefaultDriver: bridge
INFO[0000] Option DefaultNetwork: bridge
INFO[0000] Firewalld running: false
WARN[0000] Your kernel does not support cgroup memory limit: mountpoint for memory not found
WARN[0000] Your kernel does not support cgroup cfs period
WARN[0000] Your kernel does not support cgroup cfs quotas
INFO[0000] Loading containers: start.

INFO[0000] Loading containers: done.
INFO[0000] Daemon has completed initialization
INFO[0000] Docker daemon commit=0a8c2e3-dirty execdriver=native-0.2 graphdriver=overlay version=1.8.2
INFO[0040] POST /v1.20/containers/create
WARN[0040] Your kernel does not support memory swappiness capabilities, memory swappiness discarded.
INFO[0041] POST /v1.20/containers/d71ee1e67a5e43a65d7301c745fe3ca6507fc59b2c8597b7a21ef075b1450c15/attach?stderr=1&stdin=1&stdout=1&stream=1
INFO[0041] POST /v1.20/containers/d71ee1e67a5e43a65d7301c745fe3ca6507fc59b2c8597b7a21ef075b1450c15/start
WARN[0041] exit status 1
ERRO[0042] Handler for POST /containers/{name:.*}/start returned error: Cannot start container d71ee1e67a5e43a65d7301c745fe3ca6507fc59b2c8597b7a21ef075b1450c15: [8] System error: exec format error
ERRO[0042] HTTP Error err=Cannot start container d71ee1e67a5e43a65d7301c745fe3ca6507fc59b2c8597b7a21ef075b1450c15: [8] System error: exec format error statusCode=500

Search the web and found there is a similar issue: https://github.com/docker/docker/issues/14219
I think OSMC kernel needed to rebuild, could you help to fix this issue ?

Thanks.

What CONFIG options do I need to add? I have already added the settings needed

Hi Sam, I don’t have the answer to your question, but I wonder if there’s a clue in Hypriot’s Rpi-kernel repo here
GitHub - hypriot/rpi-kernel: Build a Linux kernel for Raspberry Pi 0/1/2/3/3B+

Hi Sam,
Options are:

  • CONFIG_USER_NS: missing
  • CONFIG_MEMCG_KMEM: missing
  • CONFIG_MEMCG_SWAP: missing
  • CONFIG_MEMCG_SWAP_ENABLED: missing

This script shows other options but they don’t seem to be necessary:
https://raw.githubusercontent.com/docker/docker/master/contrib/check-config.sh

In this post, http://raspberrypi.stackexchange.com/questions/70/how-to-set-up-swap-space , it is said that this options are closed because of performance. Swap file is located on the Rpi SD-Card, so using swap will be slow.
But we should give a try U1 or above classed SD-cards, I think.

Exec format error may occur because of using X86 images instead of using ARM based images(Rpi architecture).

Hi

To re-iterate, in the September update I added all of the CONFIG_ options that the upstream Raspberry Pi kernel added and people have reported success, so things should work.

Some were omitted for performance reasons

Sam

Hi there,
is docker still working on the latest version of osmc on rpi3?
Cause I get the same error as first post:

exec format error
docker: Error response from daemon: Cannot start container c815793b90efa923065ab6eaff087b28b6d188cc3f458e1a6c6f4c7ea1acaf6e: [9] System error: exec format error.

exec format error means you installed a Docker image for the wrong architecture

Yes, you are right! silly me…
Thanks for the support!