Docker Community Forums

Share and learn in the Docker community.

Mounting default service configuration files


(Kjeldflarup) #1

When I start a container I can mount a directory like this --volume /etc/apache2:/etc/apache2

However that directory is empty, and even if I exec into the container it is empty, although /etc/apache2 usually contains a lot of templates for configuration. Thus I have to copy these out first manually, and put them in my own /etc/apache2

It would be great if I could do a reverse mount, making /etc/apache2 in the container mount onto the hosts /etc/apache2.
Or even better copy the containers /etc/apache2 onto the hosts /etc/apache2

What do people do for these kinds of configurations?
It is not apache I’m setting up, but it is a well known application for many people. /etc/mysql for MySql is the same issue.