This is my very hacky way of running Kodi on my server. Every time you restart the container it installs the newest Kodi version. I did not have problems with this in the last 2 years. There is a small script that checks if a display/TV is connected before installing/starting Kodi (made by AI) It is made for Intel integrated graphics.
services: kodi: image: archlinux:latest restart: always ports: - 8080:8080 #for yatse devices: - /dev/input:/dev/input #keyboard - /dev/snd:/dev/snd #sound - /dev/dri:/dev/dri #gpu group_add: - video - audio - render - 995 volumes: - /etc/localtime:/etc/localtime:ro - /run/udev:/run/udev:ro - ./data:/root/.kodi/ - /media:/media:ro # MOUNT DRM directory to check status - /sys/class/drm:/sys/class/drm:ro # We update the command to wait for a "connected" status command: > bash -c " echo 'Checking for display connection...'; while ! grep -q '^connected' /sys/class/drm/*/status; do echo 'No display detected. Waiting 5s...'; sleep 5; done; echo 'Display detected! Starting installation/Kodi...'; pacman -Syu --noconfirm && pacman -S --noconfirm alsa-lib alsa-utils kodi-gles kodi-addon-inputstream-adaptive intel-media-driver libva-intel-driver && kodi-standalone --audio-backend=alsa"