Installing Docker on RPi 3

I have been trying to install Docker on OSMC running on my Pi3 to no vail. Using the convenience script from Docker ended up with the below error. I tried a few fixes/troubleshooting methods found on the internet and have attached those outputs as well, but no luck with any of them. Any help would be appreciated.

osmc@osmc:~$  curl -fsSL https://get.docker.com -o get-docker.sh
osmc@osmc:~$  sudo sh get-docker.sh
# Executing docker install script, commit: 7cae5f8b0decc17d6571f9f52eb840fbc13b2                                                                                        737
+ sh -c apt-get update -qq >/dev/null
+ sh -c DEBIAN_FRONTEND=noninteractive apt-get install -y -qq apt-transport-https ca-certificates curl >/dev/null
+ sh -c curl -fsSL "https://download.docker.com/linux/raspbian/gpg" | apt-key add -qq - >/dev/null
Warning: apt-key output should not be parsed (stdout is not a terminal)
+ sh -c echo "deb [arch=armhf] https://download.docker.com/linux/raspbian buster stable" > /etc/apt/sources.list.d/docker.list
+ sh -c apt-get update -qq >/dev/null
+ [ -n  ]
+ sh -c apt-get install -y -qq --no-install-recommends docker-ce >/dev/null
E: Sub-process /usr/bin/dpkg returned an error code (1)

Then I tried to install it directly and ended with the below error

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; disabled; vendor preset: enabled)
   Active: activating (auto-restart) (Result: exit-code) since Wed 2021-06-16 21:57:31 AEST; 80ms ago
     Docs: https://docs.docker.com
  Process: 1308 ExecStart=/usr/sbin/dockerd -H fd:// $DOCKER_OPTS (code=exited, status=1/FAILURE)
 Main PID: 1308 (code=exited, status=1/FAILURE)
dpkg: error processing package docker.io (--configure):
 installed docker.io package post-installation script subprocess returned error exit status 1
Processing triggers for systemd (241-7~deb10u7) ...
Errors were encountered while processing:
 docker.io
E: Sub-process /usr/bin/dpkg returned an error code (1)

systemctl status docker.service

osmc@osmc:~$ 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 Wed 2021-06-16 21:40:17 AEST; 37s ago
     Docs: https://docs.docker.com
  Process: 5203 ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock (code=exited, status=1/FAILURE)
 Main PID: 5203 (code=exited, status=1/FAILURE)

Jun 16 21:40:17 osmc systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart.
Jun 16 21:40:17 osmc systemd[1]: docker.service: Scheduled restart job, restart counter is at 3.
Jun 16 21:40:17 osmc systemd[1]: Stopped Docker Application Container Engine.
Jun 16 21:40:17 osmc systemd[1]: docker.service: Start request repeated too quickly.
Jun 16 21:40:17 osmc systemd[1]: docker.service: Failed with result 'exit-code'.
Jun 16 21:40:17 osmc systemd[1]: Failed to start Docker Application Container Engine.
Jun 16 21:40:23 osmc systemd[1]: docker.service: Start request repeated too quickly.
Jun 16 21:40:23 osmc systemd[1]: docker.service: Failed with result 'exit-code'.
Jun 16 21:40:23 osmc systemd[1]: Failed to start Docker Application Container Engine.

The last line from osmc@osmc:~$ sudo dockerd --debug

failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: iptables: Operation not supported.
 (exit status 1)

osmc@osmc:~$ journalctl -xe

Jun 16 21:29:21 osmc dockerd[4536]: time="2021-06-16T21:29:21.558190712+10:00" level=warning msg="Unable to find pids cgroup in mounts"
Jun 16 21:29:21 osmc dockerd[4536]: time="2021-06-16T21:29:21.559074879+10:00" level=info msg="Loading containers: start."
Jun 16 21:29:21 osmc dockerd[4536]: time="2021-06-16T21:29:21.614270575+10:00" level=warning msg="Running iptables --wait -t nat -L -n failed with message: `# Warning:
Jun 16 21:29:22 osmc dockerd[4536]: time="2021-06-16T21:29:22.442083418+10:00" level=info msg="stopping event stream following graceful shutdown" error="<nil>" module=l
Jun 16 21:29:22 osmc dockerd[4536]: failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKE
Jun 16 21:29:22 osmc dockerd[4536]:  (exit status 1)
Jun 16 21:29:22 osmc systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
-- Subject: Unit process exited
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- An ExecStart= process belonging to unit docker.service has exited.
--
-- The process' exit code is 'exited' and its exit status is 1.
Jun 16 21:29:22 osmc systemd[1]: docker.service: Failed with result 'exit-code'.
-- Subject: Unit failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- The unit docker.service has entered the 'failed' state with result 'exit-code'.
Jun 16 21:29:22 osmc systemd[1]: Failed to start Docker Application Container Engine.
-- Subject: A start job for unit docker.service has failed
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A start job for unit docker.service has finished with a failure.
--
-- The job identifier is 2208 and the job result is failed.
Jun 16 21:29:24 osmc systemd[1]: docker.service: Service RestartSec=2s expired, scheduling restart.
Jun 16 21:29:24 osmc systemd[1]: docker.service: Scheduled restart job, restart counter is at 4.
-- Subject: Automatic restarting of a unit has been scheduled
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- Automatic restarting of the unit docker.service has been scheduled, as the result for
-- the configured Restart= setting for the unit.
Jun 16 21:29:24 osmc systemd[1]: Stopped Docker Application Container Engine.
-- Subject: A stop job for unit docker.service has finished
-- Defined-By: systemd
-- Support: https://www.debian.org/support
--
-- A stop job for unit docker.service has finished.

It might be an iptables issue. Take a look here.

This should be fixed with the release of Kodi v19 (Matrix), which has a newer kernel for Raspberry Pi devices.

Thanks mate, that fixed it.

1 Like

great… will look forward to it