Skip to main content

Simple program to manage gbp-docker container lifecycle.

Project description


dbp is used to manage the persistence of the gbp-docker container, enabling compiler and dependency caches for faster builds. dbp requires Python (>= 3.5).


Fetch the latest release.

pip3 install dbp


  • dbp build src/ runs an out-of-tree build and stores build artifacts in ./pool/ for easy publishing
  • dbp shell launches an interactive bash shell in the development environment container
  • dbp run starts a persistent container in the background
  • dbp rm removes the persistent container

Both dbp build and dbp run use temporary containers if no container exists.

Advanced usage

Here are some fun things you can do with dbp.

Build against extra apt sources

dbp will read from the following list of inputs for extra apt sources. These sources must be in standard sources.list format.

  1. --extra-sources argument
  2. EXTRA_SOURCES environment variable
  3. ./.extra_sources file
  4. ~/.extra_sources file

For example, fill ~/.extra_sources with

deb stable opx opx-non-free
deb-src stable opx

and dbp build will search OpenSwitch for build dependencies.

$ dbp -v build src
INFO:dbp:Loaded extra sources:
deb stable opx opx-non-free
deb-src stable opx

Build a single package in a non-persistent container

dbp build src
  • Builds artifacts for the default Debian distribution
  • Uses packages found in ./pool/stretch-amd64 as build dependencies
  • Deposits artifacts in ./pool/stretch-amd64/src/
  • If workspace container does not exist, a container is created for this build and destroyed after
  • If the workspace container already exists, it is used for the build and not destroyed after
dbp --dist buster build src
  • Builds the package against Buster
  • Deposits artifacts in ./pool/buster-amd64/src/
EXTRA_SOURCES="deb 3.0.0 opx opx-non-free"
dbp build src
  • Adds EXTRA_SOURCES to sources.list

Develop inside a persistent development container

Using the run subcommand launches a persistent development container. This container will only be explicitly removed when dbp rm is run in the same directory. Then use dbp shell to enter this container.

dbp run
dbp shell

# Now we are inside the container (denoted by $ prompt)
$ cd src/

# Install build dependencies and build the package
$ gbp buildpackage

# Only install build dependencies
$ install-build-deps

# On failed builds, avoid the long gbp build time by quickly rebuilding
$ fakeroot debian/rules build

# Manually clean up
$ fakeroot debian/rules clean

# Add a new source for build dependencies by appending to the env var
deb 3.0.0 opx opx-non-free"

# Run gbp buildpackage again to do a clean build and install any new dependencies
$ gbp buildpackage

# Run an "official" build (what the CI runs)
$ cd /mnt
$ build src

# Exit the container
$ exit

# Remove the container when finished (or use `dbp run` again to re-enter the same container)
dbp rm

Important: Packages are only indexed for build dependencies in pool/${DIST}-${ARCH}/. Building with build ./src automatically deposits build artifacts into the correct directory for indexing. You can also simply copy .deb files into the directory.

Build multiple repositories

Simple add more directories to the build command.

dbp build src new-src amazing-src

Pass additional git-buildpackage options

For example, skip building when tagging by passing the correct flag.

dbp build src --gbp="--git-tag-only"

Pull any Docker image updates

dbp pull
dbp -d buster pull

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dbp-0.3.0.tar.gz (5.6 kB view hashes)

Uploaded Source

Built Distribution

dbp-0.3.0-py3-none-any.whl (12.5 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page