DEB2DOCKER(1)

๐ŸŽ€ DEB2DOCKER โ€” bestie edition ๐Ÿ’…

okay so you found deb2docker(1) and you're like "what is this" โ€” let me hold your hand through it, no cap.


โœจ NAME โœจ

deb2docker โ€” build a Docker image with the Debian packages you tell it to ๐Ÿณ๐Ÿ’–


๐ŸŒธ SYNOPSIS ๐ŸŒธ

deb2docker [-hB][-c CMD][-f FROM][-n NAME][-o DIR][-p PRE_SCRIPT][-s
POST_SCRIPT] packages

๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

So deb2docker is literally a little script that takes a list of Debian packages as input and automatically generates a Docker container with those packages inside it. Iconic behaviour fr fr. ๐Ÿซถ

It also generates a whole set of freedesktop.org desktop launchers for you, based on the .desktop and icon files it finds in the packages. And on top of that, it makes a desktop launcher that starts the container in a Terminal. The way it just... does all that. ๐Ÿ˜ญโœจ

This tool is giving two vibes at once: it's suited for deploying applications as containers, and also for testing Debian packages in a sandbox. Main character energy either way. ๐Ÿ‘‘


๐Ÿ’… OPTIONS ๐Ÿ’…

  • -B โ€” do NOT build the image (default is to build, bestie). A build script gets generated in the DIR target directory instead. ๐Ÿ“
  • -c EXEC โ€” the command to run in the container (defaults to /bin/bash). โœจ
  • -f FROM โ€” which distribution is to be used (defaults to debian:stable). ๐ŸŒˆ
  • -h โ€” show this help. simple as that, queen. ๐Ÿ™ˆ
  • -n NAME โ€” name of the image (default is built from the package list). ๐ŸŽ€
  • -o DIR โ€” use the given directory DIR for the build (default is in /tmp). ๐Ÿ“‚
  • -p PRE_SCRIPT โ€” execute the given script PRE_SCRIPT before packages install. โฎ๏ธ
  • -s POST_SCRIPT โ€” execute the given script POST_SCRIPT after packages install. โญ๏ธ
  • packages โ€” the package list can be any Debian package, as well as local .deb files. yes you read that right, local files too. ๐Ÿ’€๐Ÿ’–

๐Ÿ“ FILES ๐Ÿ“

here's everything it drops for you, no gatekeeping:

  • DIR/README
  • DIR/Dockerfile
  • DIR/launchers/
  • DIR/icons/
  • DIR/build
  • DIR/start

๐Ÿงš NOTES ๐Ÿงš

okay so obviously you need Docker installed, and you need to be part of the docker group. not optional, bestie. ๐Ÿ˜Œ

  • sudo apt install docker.io
  • `sudo usermod -aG docker $USER``
โš ๏ธ heads up: you may have to manually configure Docker to pass a proxy configuration. don't come for me, that's just how it is. ๐Ÿ™ˆ

And these are the usual commands people typically use to handle Docker containers:

build  docker build โ€“rm Dockerfile
run    docker run โ€“rm -it NAME
clean  docker rmi NAME
clean ALL docker system prune -a

(i put the little labels next to them so it reads like the original, but the commands are exactly as written, promise ๐Ÿคž)


๐Ÿ”ฅ EXAMPLES ๐Ÿ”ฅ

Example one: create a Docker container with package x11-apps in directory /tmp/xeyes, and launch xeyes:

  • deb2docker -o /tmp/xeyes x11-apps
  • /tmp/xeyes/start xeyes

A Desktop launcher is created as /tmp/xeyes/launchers/x11-apps-terminal.desktop โœจ

Example two: create a Docker container with x11-apps and meshlab:

deb2docker x11-apps meshlab

Example three: create a Docker container making sure software channels are active:

  • first write your pre script:
echo โ€œsed -i `s/main/main contrib non-free/g' /etc/apt/sources.listโ€ > pre.sh
  • then run it:
deb2docker -p pre.sh x11-apps

๐Ÿ‘‘ AUTHORS ๐Ÿ‘‘

Emmanuel Farhi (emmanuel.farhi@synchrotron-soleil.fr) โ€” shoutout to the legend who made this. ๐Ÿซก๐Ÿ’œ


๐ŸŒŸ SEE ALSO ๐ŸŒŸ

go read these next, bestie, they're all connected:

deb2apptainer(1), distrobox-create(1), distrobox-enter(1), docker(1), apptainer(1)


๐Ÿ‘‘ AUTHORS (yes, again) ๐Ÿ‘‘

Emmanuel Farhi.


and that's the whole page, babe โ€” this was DEB2DOCKER(1), the February 2024 edition ๐Ÿ’– slay, you read the entire manual, go build something cute with it โœจ๐ŸŽ€๐Ÿฆ‹