Information about my system:
root@debian:/home/user/docker/images/dovecot# cat /etc/debian_version 9.1 root@debian:/home/user/docker/images/dovecot# docker --version Docker version 17.09.0-ce, build afdb6d4 root@debian:/home/user/docker/images/dovecot# docker-compose --version docker-compose version 1.16.1, build 6d1ac21
When I try to execute a Docker-file with volumes mounted like “-v /etc/dovecot/:/etc/dovecot/” and (in that example) the dovecot-directory does not exist at the beginning, then /etc/dovecot/ is created, but the configuration-files that are in the images /etc/dovecot/ are not copied into the host’s directory, which makes dovecot fail (“Fatal: Error reading configuration: stat(/etc/dovecot/dovecot.conf) failed: No such file or directory”).
If I use “-v dovecot:/etc/dovecot/” (i.e. let docker create a new volume) the files from the image are copied into the new volume.
Is it possible to propagate the mounted host directory (if it is empty or non-existant) like the docker volume?
Thanks in advance for any replies!
EDIT: The process running inside the container seems to be able to change the volumes content; tested with a minecraft-server running in an image based on openjdk:8-jre
# cat Dockerfile FROM debian:stretch EXPOSE 143 EXPOSE 993 RUN apt-get update -q -q && \ apt-get --yes install rsyslog \ dovecot-core \ dovecot-imapd \ dovecot-mysql \ dovecot-lmtpd VOLUME /etc/dovecot/ VOLUME /var/log/dovecot/ VOLUME /var/mail/ CMD ls -al /etc/ && ls -al /etc/dovecot/ && dovecot -F #Run in foreground: https://wiki2.dovecot.org/Tools/Dovecot