Dockerized Kodi with audio and video for the raspberry pi4.
- fully-functional Kodi installation in a Docker container
- audio (ALSA or PulseAudio) and video
- simple, Raspbian image that adheres to the official Kodi installation instructions
- clean shutdown of Kodi when its container is terminated
The host system will need the following:
-
Linux and Docker
This image should work on any Linux distribution with a functional Docker installation.
-
A connected display and speaker(s)
- Create file docker-compose.yml
version: "3.7"
services:
rpi-kodi:
image: rimago/rpi-kodi
container_name: "kodi"
user: kodi
network_mode: host
restart: always
privileged: true
devices:
- /dev/fb0:/dev/fb0
- /dev/vchiq:/dev/vchiq
volumes:
- /home/pi/kodi/home:/home/kodi
- "/etc/timezone:/etc/timezone:ro"
- "/etc/localtime:/etc/localtime:ro"
tmpfs:
- /tmp
environment:
- PULSE_SERVER=127.0.0.1
WARNING: it requires the --privileged flag which is risky. Please let me know if you have an idea how to remove it.
- If you want to have the home directory outside of the container (e.g. /home/pi/kodi/home:/home/kodi) you need to add the following user to the host:
groupadd -g 9002 kodi && useradd -u 9002 -r -g kodi kodi
and make sure this user is the owner of the home directory:
chown -R kodi:kodi /home/pi/kodi/home
I am using the Kore-App for Remote-Control:
To enable it, you have to enable the Kodi webserver by creating the file
/home/pi/kodi/home/.kodi/userdata/advancedsettings.xml
with the following content:
<advancedsettings>
<services>
<esallinterfaces>true</esallinterfaces>
<webserver>true</webserver>
<zeroconf>true</zeroconf>
</services>
</advancedsettings>
The current configuration does not allow access on keyboard or mouse. If you want to use them you probably have to mount these devices in the container. Please let me know if you have figured out how that works. I am happy to add this to the Readme here.
In order to use IR remotes, add this device to your docker file:
- /dev/lirc0:/dev/lirc0
Then once the container is created, you have to manually launch lircd in the container:
docker-compose exec -u root kodi lircd
This docker project is based on erichough/kodi.
Constructive criticism and contributions are welcome! Please submit an issue or pull request.