Docker based ArchLinux build environment.
This image provides a build environment for ArchLinux packages. It is based
on the official archlinux:base-devel
image, and can be used for example to
work on packages without having to install dependencies on the host system.
It can handle dependencies coming both from the official repositories and
from AUR, as well as importing PGP keys listed in validpgpkeys
.
Run the image with the folder containing your PKGBUILD
file mounted on the
container's /pkg
folder:
docker run --rm -v "$(pwd):/pkg" mdeous/pkgbuilder [build|makepkg] [ARGS]
-
build
: the container will install all the build dependencies usingyay
, and will then build the package usingmakepkg --clean --cleanbuild --force --noconfirm
. Any additional arguments will be added to the call tomakepkg
. The resulting built package will be stored alongside thePKGBUILD
file. -
makepkg
: the container will runmakepkg
directly and pass all remaining arguments to it. This can be useful to runmakepkg
commands that don't require dependencies to be installed, like for example to show the package.SRCINFO
content, or to compute dependencies checksums. -
If neither
build
normakepkg
is passed, the container will run thebuild
command and pass all additional arguments to it.
At the end of the execution, the built package will be analyzed with
namcap
and display the results.
Additionally, the .SRCINFO
file for the package can be automatically
generated with the built package by passing a SRCINFO=1
environment
variable to the container.
To avoid having to type that long command line to run the container every time, the following shell alias can be used:
alias pkgbuilder='docker run --rm --name="pkgbuilder-$(basename ${PWD})" -v "${PWD}":/pkg mdeous/pkgbuilder:latest'