Bootstrap FreeKB - Dovecot (Email) - Install Dovecot on Docker
Dovecot (Email) - Install Dovecot on Docker

Updated:   |  Dovecot (Email) articles

At a very simple high level, Postfix is the Mail Transfer Agent (MTA) sends email to a users inbox (Mail User Agent) via SMTP (port 25 or 465 or 587) and Dovecot is the Mail Delivery Agent (MDA) that retrieves email from a users inbox via POP3 (port 110 or 995) or IMAP (port 143 or 993).

A Docker image contains the code used to create a Docker container, such as creating a Nginx web server, or a mySQL server, or a home grown app, and the list goes on. In this way, an image is like a template used to create a container. An image is kind of like a virtual machine, but much more light weight, using significantly less storage a memory (containers are usually megabytes in size).

 

The docker pull command can be used to pull down the latest dovecot image.

~]$ sudo docker pull dovecot/dovecot
Using default tag: latest
latest: Pulling from dovecot/dovecot
cb781fc06403: Pull complete
Digest: sha256:c9e72e19000e081ac169ec71f1bc30ed39c961d3e2ae940ab9478c8282bffbb2
Status: Downloaded newer image for dovecot/dovecot:latest
docker.io/dovecot/dovecot:latest

 

Or you could create Dockerfile so that the Dockerfile contains something like this.

FROM dovecot/dovecot:latest

 

Then use the docker build command to create the image, running this command in the same directory as the Dockerfile.

docker build . --tag dovecot/dovecot:latest

 

The docker images command can be used to display the dovecot image.

~]$ sudo docker images
REPOSITORY                 TAG       IMAGE ID       CREATED        SIZE
dovecot/dovecot            latest    38a098169419   4 weeks ago    159MB

 

The following command can then be used to create and start the dovecot container. Let's break down this command.

  • The docker run command is used to create and start the dovecot container.
  • The --detach flag is used to run the container in the background.
  • The --name option is used to name the container dovecot.
  • The --restart unless-stopped option is used so that the container is started if the Docker server is restarted
  • The dovecot image is used.
docker run
--detach
--restart unless-stopped
--name dovecot
dovecot/dovecot

 

The docker container ls command can be used to ensure the container is running.

~]$ sudo docker container ls
CONTAINER ID   IMAGE                      COMMAND                  CREATED          STATUS          PORTS                               NAMES
7da2c3a32c34   dovecot/dovecot            "/sbin/tini -- /usr/…"   5 seconds ago    Up 4 seconds                                        dovecot

 

The docker logs command should return something like this.

~]# sudo docker logs postfix
Mar 05 07:46:25 master: Info: Dovecot v2.3.18 (9dd8408c18) starting up for imap, pop3, submission, sieve, lmtp

 




Did you find this article helpful?

If so, consider buying me a coffee over at Buy Me A Coffee



Comments


Add a Comment


Please enter 815ceb in the box below so that we can be sure you are a human.