logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

deb2docker - Build a Docker image with given Debian packages

Authors

       Emmanuel Farhi.

                                                  February 2024                                    DEB2DOCKER(1)

Description

deb2docker  is a simple script which takes as input a list of Debian packages and generates automatically
       a Docker container including these packages.  A set of freedesktop.org desktop launchers are also  gener‐
       ated based on the .desktop and icon files found in the packages.  In addition, a desktop launcher is cre‐
       ated to start the container in a Terminal.

       This tool is suited for deploying applications as containers, as well as for testing Debian packages in a
       sandbox.

Examples

       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

       Create a Docker container with x11-apps and meshlab
         deb2docker x11-apps meshlab

       Create a Docker container making sure software channels are active:

       • echo “sed -i `s/main/main contrib non-free/g' /etc/apt/sources.list” > pre.sh

       • deb2docker -p pre.sh x11-apps

Files

       • DIR/README

       • DIR/Dockerfile

       • DIR/launchers/

       • DIR/icons/

       • DIR/build

       • DIR/start

Name

deb2docker - Build a Docker image with given Debian packages

Notes

       You need of course to have Docker installed and be part of the docker group:

       • sudo apt install docker.io

       • sudo usermod -aG docker $USER`

       You may have to manually configure Docker to pass a proxy configuration.

       Usual commands typically used to handle Docker containers are:

       build  docker build –rm Dockerfile run docker run –rm -it NAME clean docker rmi  NAME  cleanALL  docker
              system prune -a

Options

-B     do  NOT  build the image (default is to build).  A build script is generated in the DIR target di‐
              rectory.

       -cEXEC
              Command to run in the container (default to /bin/bash).

       -fFROM
              Distribution is to be used (default to debian:stable).

       -h     Show this help

       -nNAME
              Name of the image (default is built from the package list).

       -oDIR Use given directory DIR for the build (default is in /tmp).

       -pPRE_SCRIPT
              Execute the given script PRE_SCRIPT before packages install.

       -sPOST_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.

See Also

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

Synopsis

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

See Also