httpd in docker cannot start
<p>I'm trying to install HTTPD in docker, I wrote a dockerfile like this:</p>

<pre><code>FROM centos

VOLUME /var/log/httpd
VOLUME /etc/httpd
VOLUME /var/www/html

# Update Yum Repostory
RUN yum clean all &amp;&amp; \
    yum makecache fast &amp;&amp; \
    yum -y update &amp;&amp; \
    yum -y install httpd
RUN yum clean all
EXPOSE 80
CMD /usr/sbin/httpd -D BACKGROUND &amp;&amp; tail -f /var/log/httpd/access_log
</code></pre>

<p>it works if I run the image without host volumes, but failed if I use parameter:</p>

<pre><code>--volume /data/httpd/var/www/html:/var/www/html --volume /data/httpd/var/log:/var/log --volume /data/httpd/etc:/etc/httpd
</code></pre>

<p>the error message is:</p>

<pre><code>httpd: Could not open configuration file /etc/httpd/conf/httpd.conf: No such file or directory
</code></pre>

<p>I checked the mount point which is empty:</p>

<pre><code># ll /data/httpd/etc/
total 0
</code></pre>

<p>But if I don't use "volume" by default docker copys over  files to a temp folder:</p>

<pre><code># ll /var/lib/docker/volumes/04f083887e503c6138a65b300a1b40602d227bb2bbb58c69b700f6ac753d1c34/_data
total 4
drwxr-xr-x. 2 root root   35 Nov  3 03:16 conf
drwxr-xr-x. 2 root root   78 Nov  3 03:16 conf.d
drwxr-xr-x. 2 root root 4096 Nov  3 03:16 conf.modules.d
lrwxrwxrwx. 1 root root   19 Nov  3 03:16 logs -&gt; ../../var/log/httpd
lrwxrwxrwx. 1 root root   29 Nov  3 03:16 modules -&gt; ../../usr/lib64/httpd/modules
lrwxrwxrwx. 1 root root   10 Nov  3 03:16 run -&gt; /run/httpd
</code></pre>

<p>So I'm confused, why docker refused to copy them to the named location? and how to fix this problem?</p>