Docker images for building packages with clean dependencies in multiple distributions.
All images are available on docker hub https://hub.docker.com/r/seznam/dbuilder/.
The only thing you have to do is to choose a tag (generated from config.yaml) e.g. 'jessie_latest' and run: (Docker will automatically pull that image so you don't neet to build anything)
docker run --rm -v `pwd`:/dbuilder/sources seznam/dbuilder:debian_jessie
and *.deb will appear in your source directory
- Additional packages - It is possible to add additional packages to dbuilder and it will create local repository containing these files. Note the volume
/dbuilder/additional_packages
in the following example. Note, that this feature is implemented in apt-based dbuilder images only now.
# add some package
cp mypackage_1.0.9.8.2_amd64.deb ./deps/
# add another package, note that the deb package can be located
# in any subdirectory
mkdir ./deps/otherpackage_subdir/
cp otherpackage_0.22.4_all.deb ./deps/otherpackage_subdir/
# build and possibly use additional packages
docker run --rm \
-v `pwd`/deps:/dbuilder/additional_packages \
-v `pwd`/src:/dbuilder/sources \
seznam/dbuilder:debian_jessie
- Preinstall hooks - It is possible to add hooks, before dbuilder tries to satisfy build dependencies. Use volume
/dbuilder/preinstall.d
and drop executable files in. All executable files from this folder will be executed in order determined by numericsort
.
cp 00-my-fixer.sh 10-prepare-environment.py ./preinstall.d/
chmod +x ./preinstall.d/*
docker run --rm \
-v `pwd`/preinstall.d:/dbuilder/preinstall.d \
-v `pwd`/src:/dbuilder/sources \
seznam/dbuilder:debian_jessie
-
general
- DBUILDER_SUBDIR - cd to subdir before building starts
- NCPUS - concurrency
-
apt based:
- DBUILDER_BUILD_CMD - [default="dpkg-buildpackage -j${NCPUS}"]
- LOCAL_REPO_PRIORITY - sets Pin-Priority to local repository created using /dbuilder/additional_packages volume.
./generate_dockerfiles.py
make -C dockerfiles/ build
make -C dockerfiles/ push
$ ./generate_dockerfiles.py -h
Usage: generate_dockerfiles.py [options]
Options:
-h, --help show this help message and exit
-c CONFIGURATION_FILE, --configuration-file=CONFIGURATION_FILE
Configuration file path [config.yaml]
-o OUTPUT_DIR, --output-dir=OUTPUT_DIR
Output directory [./dockerfiles/]
All relative paths in configuration file are taken to dirname(configuration file).