Docker Image for building Kodi
This a is Docker image for building Kodi based on Ubuntu. It is useful if you are working on
Kodi and don't want to litter your OS with Kodi build dependencies.
Requirements
- Docker >= 19.03
Building Kodi
Prepare Docker image
docker build -t kodi-docker-build .You can do a fresh build by adding the
--no-cacheflag.
Link source code
Create a symlink to your Kodi source:
ln -s <path_to_kodi_source> xbmcOr if you just want to build the current
master-branch, simply execute
git clone https://github.com/xbmc/xbmc.git.
Create Build Output Directory
mkdir -p ~/tmp/kodibuildBuild Kodi inside Docker
The build will take up a lot of memory, so make sure to limit it accordingly.
If you run into memory issues, adaptbuild.shto only use one job (-j1).
docker run \
--rm \
-it \
--memory "8g" \
--memory-swap "8g" \
--volume $(readlink -f xbmc):/kodi/source \
--volume ~/tmp/kodibuild:/kodi/build \
kodi-docker-build:latest build.shThe first build will take a few hours.
Testing the build
You should find a kodi.bin file in the tmp/kodibuild folder in your home directory.
Execute it to test your build. If it does not work because
of missing libraries, there are two options:
- Install Kodi via
apt:
sudo add-apt-repository ppa:team-xbmc/xbmc-nightly
sudo apt-get update
sudo apt-get install kodiThis will install all missing dependencies.
- Run Kodi in a Docker container, using x11docker:
git clone https://github.com/mviereck/x11docker.git
cd x11docker
./x11docker --desktop --size 1280x800 -i --gpu --network=host --sudouser --pulseaudio -- --rm --volume ~/tmp/kodibuild:/kodi/build -- kodi-docker-build:latest bash
/kodi/build/kodi.bin --windowing=x11Clean up
Run sudo git clean -xdf to clean the build folder.
Copyright and license
Licensed under the MIT License - see LICENSE for details.