Dockerized Kodi with audio and video.
Works on amd64 Fujitsu Futro S740
- fully-functional Kodi installation in a Docker container
- audio (ALSA or PulseAudio) and video
- simple, Debian-slim 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)
services:
rpi-kodi:
image: dachack/rpi-kodi
container_name: "kodi"
user: kodi
network_mode: host
restart: unless-stopped
privileged: true
devices:
- /dev/fb0:/dev/fb0
- /dev/dri:/dev/dri
- /dev/snd:/dev/snd
- /dev/input/event3:/dev/input/event3 #Add my USB mouse and keyboard based on "evtest" output
- /dev/input/event4:/dev/input/event4
- /dev/input/event5:/dev/input/event5
- /dev/input/event6:/dev/input/event6
- /dev/input/event7:/dev/input/event7
- /dev/input/event8:/dev/input/event8
- /dev/input/event9:/dev/input/event9
volumes:
- /home/administrator/kodi/home:/home/kodi
- /etc/timezone:/etc/timezone:ro
- /etc/localtime:/etc/localtime:ro
- /var/run/dbus:/var/run/dbus
- /run/udev:/run/udev
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.
NOTE: This container is aimed to run in a Proxmox VM and thus selects the second sound card as the default device. If you run it natively, please edit asound.conf_alsa and rebuild the container or use asound.conf in the dockerfile instead!
- 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 and rimago/rpi-kodi.
Constructive criticism and contributions are welcome! Please submit an issue or pull request.