Debpic lets you build Debian packages in an isolated Docker environment.
See the man page for an introduction and usage instructions.
The Debian wiki has a list of similar tools.
| Tasks | Steps |
|---|---|
| Build package | debpic |
| Configure Container | |
| Different linux distribution | debpic --distribution debian:11 |
| Local apt repository | debpic --local-repository ~/mydebs |
| Private apt repository (configure) | Write deb822 format sources to /etc/debpic/sources.list.d/MyServer.sources |
| Private apt repository (use) | debpic --sources MyServer |
| Install extra packages | debpic --extra-pkg gdb |
| Run Container | |
| Use DEB_BUILD_OPTIONS | DEB_BUILD_OPTIONS="nocheck no_lto" debpic |
| Run command in container | debpic "my command" |
| Pass args to dpkg-buildpackage | debpic -- -b |
| Hook script (Configure) | Write script to /etc/debpic/hooks/myscript |
| Hook script (Use) | debpic --hook myscript |
| Interactive mode | debpic --interactive |
| Open VSCode in container | debpic --vscode |
| Set destination directory | debpic --destination ~/my_built_packages |
| User Experience | Info |
|---|---|
| Jenkins integration | See Using With Jenkins. |
| Tab completion | Yes |
| Man page | Yes |
| Coloured output | Yes |
| Caching | Container is cached. Ccache enabled by default. |
| Config file | ~/.config/debpic/debpic.conf |
| Built package location | ./built_packages/ |
| Include extra tools | Edit ./developer-packages.txt |
To build any debian package - Navigate to the root directory of the source code for the debian package and run the following command.
debpic -- -b --no-sign
- the
-btells dpkg-buildpackage to only build the binary package which will gets past the problemerror: can't build with source format '3.0 (quilt)': no upstream tarball ... - the
--no-signtells dpkg-buildpackage to not sign the package which gets past the problemerror: failed to sign ...
- Add the apt repository.
echo "deb https://aidangallagher.co.uk/apt-repo/ unstable main" | sudo tee /etc/apt/sources.list.d/debpic.list
- Add gpg key for apt repository.
gpg --keyserver keyserver.ubuntu.com --recv-keys 9945693042DB91DF
gpg --export 9945693042DB91DF | sudo tee /etc/apt/trusted.gpg.d/debpic.gpg > /dev/null
- Install debpic.
sudo apt update && sudo apt install debpic
NOTE: If you prefer you can download the debpic debian package directly from github.
- Configure docker to run as non-root user. See official docker documentation for more details.
sudo usermod -aG docker $USER
newgrp docker
- Optionally - configure git to globally ignore generated built_packages directory.
echo built_packages >> ~/.config/git/ignore
For more information see the documentation.
