| assets | ||
| ex | ||
| exim@fc38fe88b9 | ||
| system-integration | ||
| .dockerignore | ||
| .editorconfig | ||
| .gitignore | ||
| .gitmodules | ||
| compose.yaml | ||
| Dockerfile | ||
| Makefile | ||
| README.md | ||
Run Exim via Docker / Podman
Rationale
Exim has a versatile built time config. Depending on your target's operating system variant (distribution, version, …) dependency issues might arrise for custom builds.
Containerization provides a high isolation level between the target host and the application. Libraries inside the containerized application do not conflict with libraries of the host operating system.
Build the image
First we need the most important prerequisite: The source of the Exim version we are about to build. This is included as a sub-repo:
git submodule init exim
git submodule update exim
For building the image, either of
- official Docker version
- packaged Podman version as it comes with Debian 12 (Bookworm) can be used.
Then simply run
make CONTAINER=<engine>
where <engine> is either podman or docker.
This should produce a container image named "exim". A simple test can be
conducted running make test.
Running the image
# set container to either podman or docker
$container run \
--rm \
-v /etc/exim:/etc/exim:ro \
-v /var/log/exim:/var/log/exim \
-v /var/spool/exim:/var/spool/exim \
-v /var/lib/exim:/var/lib/exim \
-p :25 \
-p :587 \
--name exim \
exim: -bdf -q3m
If there are no options, exim -bV is started. If there are options,
and the first one starts with a dash, the shell equivalent of exim "$@" is started. If the first option doesn't start with a dash, it is
taken as a command.
Further commands can be run inside the container now. E.g.:
$container exec exim exiwhat
Install the Exim tools
$container run --rm exim 'get tools.sh' | (cd /usr/local/bin && sh)
Configuration
If you use a docker managed volume, the config volume will contain the default Exim configuration file. Feel free to edit it.
If you want to provide the /etc/exim config dir on an external volume,
via a bind mount, you can first extract the default configuration:
$container run --rm exim cat /etc/exim/exim.conf
Open issues
- Log rotation (issue #1)