Docker: You’ve got mail!

by | Feb 24, 2021

Last updated on April 11, 2025

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.

Problem

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.

Solution

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.

Conclusion

What else do you consider missing in our images? Join the discussion on Discourse and GitHub!

You May Also Like…

Icinga DB Web Automation

Icinga DB Web Automation

Icinga DB Web Automation allows you to automate monitoring tasks and integrate them directly into your systems and...

Endpoint Monitoring with Icinga

Endpoint Monitoring with Icinga

Monitoring with Icinga primarily focuses on servers and infrastructure. But there are also the people operating these...

Subscribe to our Newsletter

A monthly digest of the latest Icinga news, releases, articles and community topics.