So far we’ve chosen base images for our Icinga 2, Icinga Web 2 and Icinga DB Docker images, further reduced the image size and even taken care for security and comfort. Additionally Eric put all the images together via Docker Compose. But there’s still one little thing… e-mail.
A perfectly designed Docker image runs exactly one application in the foreground. Maybe dumb-init is needed because applications like Icinga 2 spawn more and more subprocesses and rely on the init system to automatically clean up them. But actually the container runs exactly one daemon. This design requirement isn’t a problem – as long as one doesn’t send notifications via e-mail. Icinga 2’s shipped mail notification scripts use the mail binary which uses the sendmail command. The latter one relies on a local MTA… which isn’t running as there shall be only one daemon.
Fortunately Michael suggested msmtp which doesn’t require a local MTA – configuring a remote one is enough. Additionally the msmtp-mta package provides a drop-in replacement for the sendmail binary. I.e. Icinga 2’s scripts use mail which uses sendmail (actually msmtp-mta) which sends the notification via the configured actual MTA.