Topic: iRedMail docker container failed to run when want to persist logs
I am trying to run a dockerized iredmail server as shown by the dockerized repo on github. For debug purpose, I want to mount the logs generated by the program in container to our host. So when I user tells me a mail from A to B hasn't been received for a long time, I can quickly check what has happened.
After check, I found the logs are under /var/log, so I thought just simply mounted it to a volume on host. I start the container with the following command.
docker run -itd \
--rm \
--name iredmail \
--env-file iredmail-docker.conf \
--hostname mail.webmail.spinquanta.com \
-p 80:80 \
-p 443:443 \
-p 110:110 \
-p 995:995 \
-p 143:143 \
-p 993:993 \
-p 25:25 \
-p 465:465 \
-p 587:587 \
-v /home/spinq/iredmail-docker/data/backup-mysql:/var/vmail/backup/mysql \
-v /home/spinq/iredmail-docker/data/mailboxes:/var/vmail/vmail1 \
-v /home/spinq/iredmail-docker/data/mlmmj:/var/vmail/mlmmj \
-v /home/spinq/iredmail-docker/data/mlmmj-archive:/var/vmail/mlmmj-archive \
-v /home/spinq/iredmail-docker/data/imapsieve_copy:/var/vmail/imapsieve_copy \
-v /home/spinq/iredmail-docker/data/custom:/opt/iredmail/custom \
-v /home/spinq/iredmail-docker/data/ssl:/opt/iredmail/ssl \
-v /home/spinq/iredmail-docker/data/mysql:/var/lib/mysql \
-v /home/spinq/iredmail-docker/data/clamav:/var/lib/clamav \
-v /home/spinq/iredmail-docker/data/sa_rules:/var/lib/spamassassin \
-v /home/spinq/iredmail-docker/data/postfix_queue:/var/spool/postfix \
-v /home/spinq/iredmail-docker/log:/var/log
iredmail/mariadb:stable
When I added the -v /home/spinq/iredmail-docker/log:/var/log line it failed with the following error. If I didn't have that line, everything works fine.
2023-12-12 03:49:32,432 INFO spawned: 'fail2ban' with pid 2934
2023-12-12 03:49:32,442 INFO success: fail2ban entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2023-12-12 03:49:32,447 INFO exited: nginx (exit status 1; not expected)
2023-12-12 03:49:32,450 INFO spawned: 'nginx' with pid 2935
2023-12-12 03:49:32,456 INFO success: nginx entered RUNNING state, process has stayed up for > than 0 seconds (startsecs)
2023-12-12 03:49:32,461 INFO exited: nginx (exit status 1; not expected)
2023-12-12 03:49:32,552 INFO spawned: 'nginx' with pid 2936
2023-12-12 03:49:32,553 INFO exited: fail2ban (exit status 255; not expected)
Can someone tell me why, and how should I collect logs properly?
Also, I do wants to customized the location of logs, at least give the mail.log a directory. Is there a way to implement this?
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.