111 lines
3 KiB
Groff
111 lines
3 KiB
Groff
.TH "DEB2DOCKER" "1" "February 2024" "" ""
|
|
.hy
|
|
.SH NAME
|
|
.PP
|
|
\f[B]deb2docker\f[R] - Build a Docker image with given Debian packages
|
|
.SH SYNOPSIS
|
|
.PP
|
|
\f[B]deb2docker\f[R] [-hB][-c CMD][-f FROM][-n NAME][-o DIR][-p
|
|
PRE_SCRIPT][-s POST_SCRIPT] \f[I]packages\f[R]
|
|
.SH DESCRIPTION
|
|
.PP
|
|
\f[B]deb2docker\f[R] 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 \f[I]freedesktop.org\f[R] desktop launchers are also generated
|
|
based on the .desktop and icon files found in the packages.
|
|
In addition, a desktop launcher is created to start the container in a
|
|
Terminal.
|
|
.PP
|
|
This tool is suited for deploying applications as containers, as well as
|
|
for testing Debian packages in a sandbox.
|
|
.SH OPTIONS
|
|
.TP
|
|
\f[B]-B\f[R]
|
|
do NOT build the image (default is to build).
|
|
A \f[I]build\f[R] script is generated in the DIR target directory.
|
|
.TP
|
|
\f[B]-c EXEC\f[R]
|
|
Command to run in the container (default to \f[I]/bin/bash\f[R]).
|
|
.TP
|
|
\f[B]-f FROM\f[R]
|
|
Distribution is to be used (default to \f[I]debian:stable\f[R]).
|
|
.TP
|
|
\f[B]-h\f[R]
|
|
Show this help
|
|
.TP
|
|
\f[B]-n NAME\f[R]
|
|
Name of the image (default is built from the package list).
|
|
.TP
|
|
\f[B]-o DIR\f[R]
|
|
Use given directory DIR for the build (default is in /tmp).
|
|
.TP
|
|
\f[B]-p PRE_SCRIPT\f[R]
|
|
Execute the given script \f[I]PRE_SCRIPT\f[R] before packages install.
|
|
.TP
|
|
\f[B]-s POST_SCRIPT\f[R]
|
|
Execute the given script \f[I]POST_SCRIPT\f[R] after packages install.
|
|
.TP
|
|
\f[B]packages\f[R]
|
|
The package list can be any Debian package, as well as local .deb files.
|
|
.SH FILES
|
|
.IP \[bu] 2
|
|
DIR/README
|
|
.IP \[bu] 2
|
|
DIR/Dockerfile
|
|
.IP \[bu] 2
|
|
DIR/launchers/
|
|
.IP \[bu] 2
|
|
DIR/icons/
|
|
.IP \[bu] 2
|
|
DIR/build
|
|
.IP \[bu] 2
|
|
DIR/start
|
|
.SH NOTES
|
|
.TP
|
|
You need of course to have Docker installed and be part of the \f[I]docker\f[R] group:
|
|
.IP \[bu] 2
|
|
sudo apt install docker.io
|
|
.IP \[bu] 2
|
|
sudo usermod -aG docker $USER\[ga]
|
|
.PP
|
|
You may have to manually configure Docker to pass a proxy configuration.
|
|
.PP
|
|
Usual commands typically used to handle Docker containers are:
|
|
.TP
|
|
\f[B]build\f[R]
|
|
docker build \[en]rm Dockerfile \f[B]run\f[R]
|
|
docker run \[en]rm -it NAME \f[B]clean\f[R]
|
|
docker rmi NAME \f[B]clean ALL\f[R]
|
|
docker system prune -a
|
|
.SH EXAMPLES
|
|
.TP
|
|
Create a Docker container with package \f[I]x11-apps\f[R] in directory \f[I]/tmp/xeyes\f[R], and launch \f[I]xeyes\f[R]:
|
|
.IP \[bu] 2
|
|
deb2docker -o /tmp/xeyes x11-apps
|
|
.IP \[bu] 2
|
|
/tmp/xeyes/start xeyes
|
|
.RS
|
|
.PP
|
|
A Desktop launcher is created as
|
|
/tmp/xeyes/launchers/x11-apps-terminal.desktop
|
|
.RE
|
|
.TP
|
|
Create a Docker container with \f[I]x11-apps\f[R] and \f[I]meshlab\f[R]
|
|
deb2docker x11-apps meshlab
|
|
.TP
|
|
Create a Docker container making sure software channels are active:
|
|
.IP \[bu] 2
|
|
echo \[lq]sed -i `s/main/main contrib non-free/g'
|
|
/etc/apt/sources.list\[rq] > pre.sh
|
|
.IP \[bu] 2
|
|
deb2docker -p pre.sh x11-apps
|
|
.SH AUTHORS
|
|
.PP
|
|
Emmanuel Farhi (emmanuel.farhi\[at]synchrotron-soleil.fr)
|
|
.SH SEE ALSO
|
|
.PP
|
|
deb2apptainer(1), distrobox-create(1), distrobox-enter(1), docker(1),
|
|
apptainer(1)
|
|
.SH AUTHORS
|
|
Emmanuel Farhi.
|