Docker: You’ve got mail!

by | Feb 24, 2021

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…

It’s all about the tools, is it?

It’s all about the tools, is it?

User Interface design or product design in general is less about tools than it is to have a proper understanding about...

Web Access Control Redefined

Web Access Control Redefined

One of the focuses of version 2.9 of Icinga Web 2 will be on access control. For years on now, Icinga Web 2 had a very...

Subscribe to our Newsletter

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