DEBOCKER(8)

✨ NAME ✨

debocker β€” build Debian packages with docker. That's it, that's the whole vibe. It lives in section 8 of the manual, so it's the DEBOCKER(8) page, and it's iconic for anyone who's ever cried over a build chain. 🫢


🌸 SYNOPSIS 🌸

debocker [OPTS] COMMAND [COMMAND OPTS] [ARGS]

πŸ’– DESCRIPTION πŸ’–

Okay so bestie, here's the tea: debocker builds Debian packages inside docker. The whole build process is contained in docker images, so (almost) no other tools are needed to develop Debian packages on your main system. No cap. And because docker's image cache reuses the same system state whenever possible, when a package gets built for the second time, its dependencies and buildchain are not downloaded nor installed again. The way that it just... remembers? Obsessed. πŸ’…

Debocker can also create a self-contained bundle with everything necessary to build a package with docker only. One little file, all the power. πŸ‘‘

You do not have to be root to run debocker, but you do have to be able to use docker(1) command. In Debian, that means you must be a member of the docker group. That's the entry fee, babes. πŸŽ€

The build process consists of 5 steps:

  1. uprade β€” the base image is updated to the most recent packages (with apt-get)
  2. install-utils β€” the Debian toolchain is installed
  3. install-deps β€” the build dependencies of the package are installed
  4. extract-source β€” the source package is extracted
  5. build β€” the proper build is executed

🌈 COMMANDS 🌈

Every single command accepts a --help option that shows its basic CLI usage. Use it, fr fr, it's free. ✨

  • bundle [OPTS] [PATH] β€” Create a tarball file containing sources of a package in the current directory, and a series of scripts to build it using docker. The resulting bundle is stored in the parent directory as a tarball. If the package is non-native, the original tarball must be present in the parent directory. However, if the original tarball is not present, debocker will try to extract it using pristine-tar(1). 🧚

The bundle is independent from debocker and can be used with docker only (see EXAMPLES). She's self-sufficient, she doesn't need you like that. πŸ’…

Arguments:

  • PATH β€” optional path to the package; defaults to the current directory

Options:

  • -o FILE, --output FILE β€” store bundle in FILE; the file is a traditional tarball with a Debian source package, a Dockerfile, and some utils
  • -f FLAGS, --flags FLAGS β€” define builds flags that bundle will use; these are passed to dpkg-buildpackage
  • --from STEP β€” invalidate STEP causing docker to restart from this step, even if previous cache exists; possible values are: build, extract-source, install-deps, install-utils, upgrade
  • --image IMAGE β€” define the base docker image to use; defaults to debian:unstable
  • build-bundle [OPTS] BUNDLE β€” Build a tarball file created with bundle by running the process in docker and extracting the final files to the current directory. This multi-step process takes advantage of docker's cache whenever possible, saving space and making successive builds very fast. πŸš€

Arguments:

  • BUNDLE β€” the location of a bundle to build

Options:

  • -o DIRECTORY, --output DIRECTORY β€” store the built files in DIRECTORY
  • -s, --sign β€” sign the results of the build; this requires installed debsign (see devscripts(1))
  • --no-cache β€” do not use docker's image cache (passed directly to docker build); this effectively restarts the whole build from the start
  • --pull β€” pull the newest base image if available (passed directly to docker build)
  • build [OPTS] [PATH] β€” Create a temporary bundle with bundle and build it with build-bundle. The respective options are passed unchanged to the subcommands (e.g., -s can be used to sign packages). It's giving manager energy β€” she delegates, she doesn't do the work herself. 😌

πŸ’… OPTIONS πŸ’…

  • -v, --verbose β€” Make debocker's output verbose. Spill everything, we want the details. πŸ—£οΈ
  • --help β€” Show summary of CLI usage.
Global options must be given before the name of the command. Before, bestie. Order matters, don't test her. ⚠️

πŸŽ€ FILES πŸŽ€

There are no config files. Nothing to edit, nothing to break, nothing to commit by accident. Lowkey a blessing. πŸ™ˆ


⭐ EXAMPLES ⭐

Assuming that you are in a directory with a Debian source package:

$ debocker build

will build the package in Debian unstable (the built files will be stored in the parent directory). If the build was successful, every subsequent run should use cache instead. You may force rebuild at any stage by using --from option. To rebuild the package, you may use:

$ debocker build --from=build

The build command is equivalent, save for the undeleted, intermediary file, with:

$ debocker bundle --output /tmp/bundle.tar
$ debocker build-bundle /tmp/bundle.tar --output ..

You may pass custom flags to your build:

$ debocker build --flags='-j4'

To create a (pseudo)-reproducible, compressed bundle with your package and to build it using docker:

$ debocker bundle --output /tmp/bundle.tar
$ docker run - < /tmp/bundle.tar

πŸ’€ BUGS πŸ’€

Debocker does not clean after itself. If you are not careful, docker images may consume a lot of space. Not me leaving a little mess everywhere I go. 😭

And probably many more.

Be careful out there. She's messy and she knows it. 🫠

πŸ‘‘ AUTHOR πŸ‘‘

Initial idea and coding has been done by Tomasz Buchert tomasz@debian.org.

Initial packaging, many ideas and a lot of support by Dariusz Dwornikowski.

The semi-official homepage is http://debocker.debian.net. Go say hi. 🌸


πŸ¦‹ SEE ALSO πŸ¦‹

pbuiler(8), docker(1), devscripts(1), pristine-tar(1)


And that's the whole page, bestie β€” this one comes to you from Debian, dated July 2015, section 8, and yeah, the date is giving vintage but the energy is timeless. Study it, slay it, build those packages. πŸ’–βœ¨πŸŽ€πŸ«Ά