Another image I build for myself because I don’t want to use 3rd party non-official images from DockerHub. They could do anything with my precious emails. Also, building a docker image for dovecot is pretty straightforward.
The Dockerfile just has to install the Dovecot packages, expose the imap ports and start Dovecot:
Dovecot will start in foreground, keeping the container alive. We want to check the logs via docker logs so we redirect all dovecot log output to stderr:
log_path = /dev/stderr
The Dockerfile will copy that config file to the image.
Start the build like this:
docker build -t dovecot:188.8.131.52-r0-2 .
Done. Again, you can pick up my Dovecot image on DockerHub. But I guess if you read this article, you want to build your own image?
Also, check out my Postfix image.