Docker Community Forums

Share and learn in the Docker community.

Sharing a volume on Windows with Docker toolbox

I’m trying to setup a dev environment trough a docker container on my windows 7 computer. I’ve installed Docker toolbox for windows.

I have an image with apache and php5.6 within, here it is :

FROM php:5.6.15-apache

RUN apt-get update && apt-get install -y \
apt-utils vim git php5-mysql php5-memcache php5-memcached php5-intl \
RUN apt-get install libapache2-mod-php5 -y -o Dpkg::Options::="--force-confdef"
RUN docker-php-ext-install mbstring
RUN docker-php-ext-install pdo pdo_mysql
RUN apt-get install libcurl4-gnutls-dev -y
RUN docker-php-ext-install curl
RUN a2enmod rewrite

ENV APACHE_LOG_DIR /var/log/apache2
ENV APACHE_LOCK_DIR /var/lock/apache2


COPY php.ini /usr/local/etc/php/php.ini
COPY apache-config.conf /etc/apache2/sites-enabled/000-default.conf
RUN echo "ServerName" >> /etc/apache2/apache2.conf

This image is created and I can see it when I run “docker images” in the docker quickstart terminal.

In my apache-config.conf, I just have a tiny virtual host to access a test website with just an index.php file.

Then I try to create the container in the Docker quickstart terminal :

docker run --name=php5.6_container --rm -v "//c/sites:/var/www/html" -p 80:80 -p 8080:8080 php5.6

I get the following error :

" AH00112: Warning: DocumentRoot [/var/www/html/test] does not exist AH00112: Warning: DocumentRoot [/var/www/html/test] does not exist [Tue Dec 08 16:36:37.703143 2015] [mpm_prefork:notice] [pid 1] AH00163: Apache/2.4.10 (Debian) configured – resuming normal operations [Tue Dec 08 16:36:37.703733 2015] [core:notice] [pid 1] AH00094: Command line: ’ apache2 -D FOREGROUND’ "

It seems like my volume option is not taken into account. And the container is not created. Does anyone has an idea of what I could be doing wrong ?

For those interested in an answer, you can find it here :

Turned out I had to move my files in the C/Users/Public folder

docker run --name=php5.6_container --rm -v “/c/Users/sites:/var/www/html” -p 80:80 -p 8080:8080 php5.6