Install Docker for OSMC on Raspberry Pi.
Tested on Raspberry Pi 2B, OSMC 2020.11-1.
Check version, release and keyname of OS:
$ cat /etc/debian_version
10.10
$ cat /etc/os-release
ID=osmc
$ lsb_release -cs
buster
lsb_release
should be available in OSMC.
Not switching to iptables-legacy
will make docker engine fail to connect to daemon at unix:///var/run/docker.sock
, failing the installation.
To fix:
sudo update-alternatives --config iptables
When prompted, choose option 1 iptables-legacy
.
osmc@osmc:~$ sudo update-alternatives --config iptables
There are 2 choices for the alternative iptables (providing /usr/sbin/iptables).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/sbin/iptables-nft 20 auto mode
* 1 /usr/sbin/iptables-legacy 10 manual mode
2 /usr/sbin/iptables-nft 20 manual mode
Press <enter> to keep the current choice[*], or type selection number: 1
Taken from Guide from Docker
Get script & execute script:
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
Taken from Post-installation steps for Linux
To run Docker on default user osmc
:
sudo usermod -aG docker osmc
Restart Docker service:
sudo /etc/init.d/docker restart
Logout and log back in. You can just disconnect SSH session then SSH back.
Should be able to run this with osmc
user.
docker run hello-world