Docker support

Hi Sam,

Thanks, I just checked it.
To make it faster I installed ready deb package: docker-hypriot_1.10.3-1_armhf.deb that I was using on RPi.
Only modification on my side was to make it to use aufs instead of overlay.

The result is that docker service started and I was able to execute docker run aarch64/hello-world without any errors.
To fully test if everything works (network etc) I will need some time to prepare new containers. The one that I was using was for armhf and I think I need to change them to aarch64 version.

Thanks for your help.

OSMC’s userland is armhf, but the kernel is arm64, so you should be able to run both types of containers without issue.

Let me know if you run in to any problems

Cheers

Sam

Yes, you are right.
Previously I tried to run some random hello-world container that was described as armhf and it gave me bad exec format error. I think there was something wrong with this container. When I tried my old containers from rpi they started without any issues.

It looks like everything works for me.

Thanks again for your support.

Just a quick question - if I remove jessie-devel from sources - will I loose your changes on next “main” OSMC update?

No – it’s fine to remove this repository now unless you need to test something bleeding edge in the future.

Thanks for testing and confirming all is working as expected.

Sam

Just wanted to left a note for anyone that will try to setup docker on Vero 4K.

There is no need to compile sources to get latest docker version.
It is possible to use official docker installation script available here: https://get.docker.com/

Until they add support for aarch64 there is only one small hack needed:
In this script find line:
architecture=$(uname -m)
and change it to:
architecture="armv7l"

Thats it.

3 Likes

I installed dokcer-ce (docker isn’t supported on Debian Jessie anymore) using the following commands.

Install https curl prerequisites:

 sudo apt-get install      apt-transport-https      ca-certificates      curl      gnupg2      software-properties-common

Add docker gpg

curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -

Add docker to sources

echo "deb [arch=armhf] https://download.docker.com/linux/debian \
 $(lsb_release -cs) stable" |     sudo tee /etc/apt/sources.list.d/docker.list

Apt-get update

sudo apt-get update

Install docker-ce

sudo apt-get install docker-ce

Run an Hello World test

sudo docker run armhf/hello-world

osmc@osmc:/usr/share/menu$ sudo docker run armhf/hello-world

Hello from Docker on armhf!
This message shows that your installation appears to be working correctly.

To generate this message, Docker took the following steps:
 1. The Docker client contacted the Docker daemon.
 2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
 3. The Docker daemon created a new container from that image which runs the
    executable that produces the output you are currently reading.
 4. The Docker daemon streamed that output to the Docker client, which sent it
    to your terminal.

Hi Sam,

I’m running into aufs/auplink errors. Can I use this solution too?

Kind regards,

Duncan.

Hi @Duncan

AUFS is merged in the kernel for some time:

I’m not sure how much it’s been tested though. What errors are you seeing?

Sam

Hi Sam,

Good to know. Here the complete log from the systemctl.

root@osmc:/usr/share/menu# systemctl status docker -l

  • docker.service - Docker Application Container Engine
    Loaded: loaded (/lib/systemd/system/docker.service; enabled)
    Active: active (running) since Sat 2017-10-07 17:20:20 CEST; 3h 43min ago
    Docs: https://docs.docker.com
    Main PID: 19583 (dockerd)
    CGroup: /system.slice/docker.service
    |-19583 /usr/bin/dockerd -H fd://
    `-19590 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir /var/run/docker/libcontainerd/containerd --shim docker-containerd-shim --runtime docker-runc

Oct 07 17:20:19 osmc dockerd[19583]: , error: exit status 1"
Oct 07 17:20:19 osmc dockerd[19583]: time=“2017-10-07T17:20:19.856333362+02:00” level=warning msg=“Could not load necessary modules for IPSEC rules: Running modprobe xfrm_user failed with message: modprobe: WARNING: Module xfrm_user not found., error: exit status 1”
Oct 07 17:20:19 osmc dockerd[19583]: time=“2017-10-07T17:20:19.870744107+02:00” level=info msg=“Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address”
Oct 07 17:20:20 osmc dockerd[19583]: time=“2017-10-07T17:20:20.142142824+02:00” level=info msg=“Loading containers: done.”
Oct 07 17:20:20 osmc dockerd[19583]: time=“2017-10-07T17:20:20.147452732+02:00” level=warning msg=“Couldn’t run auplink before unmount /var/lib/docker/tmp/docker-aufs-union698455484: exec: “auplink”: executable file not found in $PATH”
Oct 07 17:20:20 osmc dockerd[19583]: time=“2017-10-07T17:20:20.253623777+02:00” level=info msg=“Docker daemon” commit=afdb6d4 graphdriver(s)=aufs version=17.09.0-ce
Oct 07 17:20:20 osmc dockerd[19583]: time=“2017-10-07T17:20:20.254136451+02:00” level=info msg=“Daemon has completed initialization”
Oct 07 17:20:20 osmc dockerd[19583]: time=“2017-10-07T17:20:20.304331119+02:00” level=info msg=“API listen on /var/run/docker.sock”
Oct 07 17:20:20 osmc systemd[1]: Started Docker Application Container Engine.
Oct 07 17:20:20 osmc systemd[1]: [/lib/systemd/system/docker.service:25] Unknown lvalue ‘Delegate’ in section ‘Service’
Oct 07 17:22:08 osmc dockerd[19583]: time=“2017-10-07T17:22:08.182297640+02:00” level=warning msg=“Couldn’t run auplink before unmount /var/lib/docker/aufs/mnt/979f90bc1fea2832022e6f39fd7d5fc7de296f9c285663cbaaf73eeda65504ae-init: exec: “auplink”: executable file not found in $PATH”
Oct 07 17:22:08 osmc dockerd[19583]: time=“2017-10-07T17:22:08.506322684+02:00” level=warning msg=“Couldn’t run auplink before unmount /var/lib/docker/aufs/mnt/979f90bc1fea2832022e6f39fd7d5fc7de296f9c285663cbaaf73eeda65504ae: exec: “auplink”: executable file not found in $PATH”
Oct 07 17:22:10 osmc dockerd[19583]: time=“2017-10-07T17:22:10.843541133+02:00” level=warning msg=“Couldn’t run auplink before unmount /var/lib/docker/aufs/mnt/979f90bc1fea2832022e6f39fd7d5fc7de296f9c285663cbaaf73eeda65504ae: exec: “auplink”: executable file not found in $PATH”
Oct 07 17:32:56 osmc dockerd[19583]: time=“2017-10-07T17:32:56.789800997+02:00” level=warning msg=“Couldn’t run auplink before unmount /var/lib/docker/aufs/mnt/63fc19cca16bc18d547d82716428bd2eb84d6aec68ce7d0f42312a2adc1d4927-init: exec: “auplink”: executable file not found in $PATH”
Oct 07 17:32:57 osmc dockerd[19583]: time=“2017-10-07T17:32:57.151532859+02:00” level=warning msg=“Couldn’t run auplink before unmount /var/lib/docker/aufs/mnt/63fc19cca16bc18d547d82716428bd2eb84d6aec68ce7d0f42312a2adc1d4927: exec: “auplink”: executable file not found in $PATH”
Oct 07 17:32:59 osmc dockerd[19583]: time=“2017-10-07T17:32:59.003504279+02:00” level=warning msg=“Couldn’t run auplink before unmount /var/lib/docker/aufs/mnt/63fc19cca16bc18d547d82716428bd2eb84d6aec68ce7d0f42312a2adc1d4927: exec: “auplink”: executable file not found in $PATH”
Oct 07 17:48:34 osmc dockerd[19583]: time=“2017-10-07T17:48:34.823929119+02:00” level=warning msg=“Couldn’t run auplink before unmount /var/lib/docker/aufs/mnt/4aada9c24b2cac804183494023d8915b26836c0d2331aa56db1c1ee5c77be5fd-init: exec: “auplink”: executable file not found in $PATH”
Oct 07 17:48:35 osmc dockerd[19583]: time=“2017-10-07T17:48:35.571962486+02:00” level=warning msg=“Couldn’t run auplink before unmount /var/lib/docker/aufs/mnt/4aada9c24b2cac804183494023d8915b26836c0d2331aa56db1c1ee5c77be5fd: exec: “auplink”: executable file not found in $PATH”
Oct 07 17:48:45 osmc dockerd[19583]: time=“2017-10-07T17:48:45.303504222+02:00” level=warning msg=“Couldn’t run auplink before unmount /var/lib/docker/aufs/mnt/4aada9c24b2cac804183494023d8915b26836c0d2331aa56db1c1ee5c77be5fd: exec: “auplink”: executable file not found in $PATH”
Oct 07 17:55:57 osmc dockerd[19583]: time=“2017-10-07T17:55:57.533646091+02:00” level=error msg=“Error setting up exec command in container 91eadf060eebb2401b68240cb4c33468262183939fb44499a023d2fb391fa1b5: Container 91eadf060eebb2401b68240cb4c33468262183939fb44499a023d2fb391fa1b5 is not running”
Oct 07 17:56:10 osmc dockerd[19583]: time=“2017-10-07T17:56:10.553691565+02:00” level=warning msg=“Couldn’t run auplink before unmount /var/lib/docker/aufs/mnt/4aada9c24b2cac804183494023d8915b26836c0d2331aa56db1c1ee5c77be5fd: exec: “auplink”: executable file not found in $PATH”
Oct 07 17:56:12 osmc dockerd[19583]: time=“2017-10-07T17:56:12.507712125+02:00” level=error msg=“Error setting up exec command in container 91eadf060eebb2401b68240cb4c33468262183939fb44499a023d2fb391fa1b5: Container 91eadf060eebb2401b68240cb4c33468262183939fb44499a023d2fb391fa1b5 is not running”
Oct 07 17:56:17 osmc dockerd[19583]: time=“2017-10-07T17:56:17.472743037+02:00” level=error msg=“Error setting up exec command in container 91eadf060eebb2401b68240cb4c33468262183939fb44499a023d2fb391fa1b5: Container 91eadf060eebb2401b68240cb4c33468262183939fb44499a023d2fb391fa1b5 is not running”
Oct 07 17:59:54 osmc dockerd[19583]: time=“2017-10-07T17:59:54.713514135+02:00” level=warning msg=“Couldn’t run auplink before unmount /var/lib/docker/aufs/mnt/4aada9c24b2cac804183494023d8915b26836c0d2331aa56db1c1ee5c77be5fd: exec: “auplink”: executable file not found in $PATH”
Oct 07 18:01:21 osmc dockerd[19583]: time=“2017-10-07T18:01:21.733606096+02:00” level=warning msg=“Couldn’t run auplink before unmount /var/lib/docker/aufs/mnt/4aada9c24b2cac804183494023d8915b26836c0d2331aa56db1c1ee5c77be5fd: exec: “auplink”: executable file not found in $PATH”

Seems like auplink isn’t default present when you install docker.

ausfs messages seem to be warnings.

Oct 07 17:20:19 osmc dockerd[19583]: , error: exit status 1"
Oct 07 17:20:19 osmc dockerd[19583]: time=“2017-10-07T17:20:19.856333362+02:00” level=warning msg=“Could not load necessary modules for IPSEC rules: Running modprobe xfrm_user failed with message: modprobe: WARNING: Module xfrm_user not found., error: exit status 1”

This is probably what it is crashing on.

root@osmc:/usr/share/menu# modprobe -va xfrm_user
modprobe: WARNING: Module xfrm_user not found.

Something IPsec’y

Another user, @inahike seems to have got Docker to work without problems. Maybe he can share his solution.

@Duncan Can you give this a go?

I’m attempting to install Docker on Vero running OSMC 2018.08-2 and followed the guide posted by @inahike, which failed. Log here.

Since there isn’t a raspbian stretch distro in the dockerproject repo, I replaced raspbian-jessie with debian-stretch in docker.list but it also failed. Log here.

Any suggestions?

What you ideally need is a Debian stretch package for armhf. Looking at the repo, the latest version of Docker (17.05.0) has an armhf version for debian-jessie, raspbian-jessie, ubuntu-trusty and ubuntu-xenial.

The debian-stretch package is only available on the amd64 architecture, whereas debian-jessie is (and has been on older versions) available on both amd64 and armhf. Go figure.

That was my thinking @dillthedog. I wasn’t optimistic trying the debian-stretch and raspbian-jessie packages but figured I’d try. That being the case, any suggestions for next steps? Reach out to the Docker project?

Why do you need Raspbian packages?
You can just use armhf packages.

Sam

I don’t. I was unclear in my post. I tried the debian-stretch package and the install failed. Because @inahike had success with raspbian-jessie, I was hoping I might have luck with a raspbian-stretch package (for newer osmc version). However, since there isn’t a raspbian-stretch package available, I tried jessie, of course it failed as well.

Being a curious kind of dog, I tried to install the Debian jessie package on a fully updated system – and it worked. Not sure why yours didn’t. I directly downloaded the package from the repo:

osmc@osmc:~$ wget http://apt.dockerproject.org/repo/pool/main/d/docker-engine/docker-engine_17.05.0~ce-0~debian-jessie_armhf.deb
--2018-10-10 06:31:17--  http://apt.dockerproject.org/repo/pool/main/d/docker-engine/docker-engine_17.05.0~ce-0~debian-jessie_armhf.deb
Resolving apt.dockerproject.org (apt.dockerproject.org)... 52.222.241.12
Connecting to apt.dockerproject.org (apt.dockerproject.org)|52.222.241.12|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 16555754 (16M) [application/vnd.debian.binary-package]
Saving to: ‘docker-engine_17.05.0~ce-0~debian-jessie_armhf.deb’

docker-engine_17.05 100%[===================>]  15.79M   797KB/s    in 20s     

2018-10-10 06:31:39 (803 KB/s) - ‘docker-engine_17.05.0~ce-0~debian-jessie_armhf.deb’ saved [16555754/16555754]

and then installed it:

osmc@osmc:~$ sudo dpkg -i docker-engine_17.05.0~ce-0~debian-jessie_armhf.deb
Selecting previously unselected package docker-engine.
(Reading database ... 26310 files and directories currently installed.)
Preparing to unpack docker-engine_17.05.0~ce-0~debian-jessie_armhf.deb ...
Unpacking docker-engine (17.05.0~ce-0~debian-jessie) ...
dpkg: dependency problems prevent configuration of docker-engine:
 docker-engine depends on libltdl7 (>= 2.4.2); however:
  Package libltdl7 is not installed.

dpkg: error processing package docker-engine (--install):
 dependency problems - leaving unconfigured
Processing triggers for systemd (232-25+deb9u4) ...
Processing triggers for man-db (2.7.6.1-2) ...
Errors were encountered while processing:
 docker-engine
osmc@osmc:~$ sudo apt-get install libltdl7
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
  libltdl7
0 upgraded, 1 newly installed, 0 to remove and 5 not upgraded.
1 not fully installed or removed.
Need to get 386 kB of archives.
After this operation, 414 kB of additional disk space will be used.
Get:1 http://ftp.debian.org/debian stretch/main armhf libltdl7 armhf 2.4.6-2 [386 kB]
Fetched 386 kB in 31s (12.3 kB/s)        
Selecting previously unselected package libltdl7:armhf.
(Reading database ... 26518 files and directories currently installed.)
Preparing to unpack .../libltdl7_2.4.6-2_armhf.deb ...
Unpacking libltdl7:armhf (2.4.6-2) ...
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Setting up libltdl7:armhf (2.4.6-2) ...
Setting up docker-engine (17.05.0~ce-0~debian-jessie) ...
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service → /lib/systemd/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket → /lib/systemd/system/docker.socket.
Processing triggers for libc-bin (2.24-11+deb9u3) ...
Processing triggers for systemd (232-25+deb9u4) ...
osmc@osmc:~$ sudo dpkg -i docker-engine_17.05.0~ce-0~debian-jessie_armhf.deb
(Reading database ... 26526 files and directories currently installed.)
Preparing to unpack docker-engine_17.05.0~ce-0~debian-jessie_armhf.deb ...
Unpacking docker-engine (17.05.0~ce-0~debian-jessie) over (17.05.0~ce-0~debian-jessie) ...
Setting up docker-engine (17.05.0~ce-0~debian-jessie) ...
Processing triggers for systemd (232-25+deb9u4) ...
Processing triggers for man-db (2.7.6.1-2) ...
osmc@osmc:~$ systemctl status docker
● docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: active (running) since Wed 2018-10-10 06:43:29 UTC; 1min 34s ago
     Docs: https://docs.docker.com
 Main PID: 4121 (dockerd)
   CGroup: /system.slice/docker.service
           ├─4121 /usr/bin/dockerd -H fd://
           └─4127 docker-containerd -l unix:///var/run/docker/libcontainerd/docker-containerd.sock --metrics-interval=0 --start-timeout 2m --state-dir

Oct 10 06:43:27 osmc dockerd[4121]: time="2018-10-10T06:43:27.019854895Z" level=warning msg="Your kernel does not support cgroup blkio weight_device"
Oct 10 06:43:27 osmc dockerd[4121]: time="2018-10-10T06:43:27.020633800Z" level=warning msg="mountpoint for pids not found"
Oct 10 06:43:27 osmc dockerd[4121]: time="2018-10-10T06:43:27.022311036Z" level=info msg="Loading containers: start."
Oct 10 06:43:28 osmc dockerd[4121]: time="2018-10-10T06:43:28.440938352Z" level=info msg="Default bridge (docker0) is assigned with an IP address 172.
Oct 10 06:43:29 osmc dockerd[4121]: time="2018-10-10T06:43:29.158551160Z" level=info msg="Loading containers: done."
Oct 10 06:43:29 osmc dockerd[4121]: time="2018-10-10T06:43:29.199019466Z" level=warning msg="Not using native diff for overlay2: failed to set opaque 
Oct 10 06:43:29 osmc dockerd[4121]: time="2018-10-10T06:43:29.901670897Z" level=info msg="Daemon has completed initialization"
Oct 10 06:43:29 osmc dockerd[4121]: time="2018-10-10T06:43:29.902745790Z" level=info msg="Docker daemon" commit=89658be graphdriver=overlay2 version=1
Oct 10 06:43:29 osmc dockerd[4121]: time="2018-10-10T06:43:29.953273660Z" level=info msg="API listen on /var/run/docker.sock"
Oct 10 06:43:29 osmc systemd[1]: Started Docker Application Container Engine.

As you can see, there was a missing dependency, libltdl7, but docker installed successfully once that dependency was fixed.

Thanks for demonstrating a successful install. I followed your steps and ran into Failed to start Docker Application Container Engine.

osmc@osmc-turtle:~$ sudo dpkg -i docker-engine_17.05.0~ce-0~debian-jessie_armhf.deb
Selecting previously unselected package docker-engine.
(Reading database ... 55494 files and directories currently installed.)
Preparing to unpack docker-engine_17.05.0~ce-0~debian-jessie_armhf.deb ...
Unpacking docker-engine (17.05.0~ce-0~debian-jessie) ...
Setting up docker-engine (17.05.0~ce-0~debian-jessie) ...
Created symlink /etc/systemd/system/multi-user.target.wants/docker.service -> /lib/system                                                                                                                        d/system/docker.service.
Created symlink /etc/systemd/system/sockets.target.wants/docker.socket -> /lib/systemd/sy                                                                                                                        stem/docker.socket.
Job for docker.service failed because the control process exited with error code.
See "systemctl status docker.service" and "journalctl -xe" for details.
invoke-rc.d: initscript docker, action "start" failed.
* docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Sat 2018-10-13 10:02:54 ED                                                                                                                        T; 35ms ago
     Docs: https://docs.docker.com
  Process: 23776 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
 Main PID: 23776 (code=exited, status=1/FAILURE)
      CPU: 551ms

Oct 13 10:02:54 osmc-turtle systemd[1]: Failed to start Docker Application Container…ine.
Oct 13 10:02:54 osmc-turtle systemd[1]: docker.service: Unit entered failed state.
Oct 13 10:02:54 osmc-turtle systemd[1]: docker.service: Failed with result 'exit-code'.
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: error processing package docker-engine (--install):
 subprocess installed post-installation script returned error exit status 1
Processing triggers for systemd (232-25+deb9u4) ...
Processing triggers for man-db (2.7.6.1-2) ...
Errors were encountered while processing:
 docker-engine
osmc@osmc-turtle:~$ sudo systemctl status docker.service
* docker.service - Docker Application Container Engine
   Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Sat 2018-10-13 10:03:00 EDT; 1min 58s ago
     Docs: https://docs.docker.com
  Process: 24609 ExecStart=/usr/bin/dockerd -H fd:// (code=exited, status=1/FAILURE)
 Main PID: 24609 (code=exited, status=1/FAILURE)
      CPU: 506ms

Oct 13 10:03:00 osmc-turtle systemd[1]: Failed to start Docker Application Container Engi
Oct 13 10:03:00 osmc-turtle systemd[1]: docker.service: Unit entered failed state.
Oct 13 10:03:00 osmc-turtle systemd[1]: docker.service: Failed with result 'exit-code'.
Oct 13 10:03:00 osmc-turtle systemd[1]: docker.service: Service hold-off time over, sched
Oct 13 10:03:00 osmc-turtle systemd[1]: Stopped Docker Application Container Engine.
Oct 13 10:03:00 osmc-turtle systemd[1]: docker.service: Start request repeated too quickl
Oct 13 10:03:00 osmc-turtle systemd[1]: Failed to start Docker Application Container Engi
Oct 13 10:03:00 osmc-turtle systemd[1]: docker.service: Unit entered failed state.
Oct 13 10:03:00 osmc-turtle systemd[1]: docker.service: Failed with result 'exit-code'.

osmc@osmc-turtle:~$ journalctl -xe
-- Unit docker.socket has begun starting up.
Oct 13 10:03:00 osmc-turtle systemd[1]: Listening on Docker Socket for the API.
-- Subject: Unit docker.socket has finished start-up
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit docker.socket has finished starting up.
--
-- The start-up result is done.
Oct 13 10:03:00 osmc-turtle systemd[1]: docker.service: Start request repeated too quickl
Oct 13 10:03:00 osmc-turtle systemd[1]: Failed to start Docker Application Container Engi
-- Subject: Unit docker.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Unit docker.service has failed.
--
-- The result is failed.
Oct 13 10:03:00 osmc-turtle systemd[1]: docker.socket: Unit entered failed state.
Oct 13 10:03:00 osmc-turtle systemd[1]: docker.service: Unit entered failed state.
Oct 13 10:03:00 osmc-turtle systemd[1]: docker.service: Failed with result 'exit-code'.
Oct 13 10:04:59 osmc-turtle sudo[24690]:     osmc : TTY=pts/0 ; PWD=/home/osmc ; USER=roo
Oct 13 10:04:59 osmc-turtle sudo[24690]: pam_unix(sudo:session): session opened for user
Oct 13 10:05:16 osmc-turtle sudo[24690]: pam_unix(sudo:session): session closed for user

osmc@osmc-turtle:~$

Any additional suggestions?