Volume mounts in windows does not work

Hi All,

I have been trying to work this out on and off over the last few days, and have finally cracked it with some help from Kitematic - for myself at least. I am using docker-compose, but I imagine it should be the same.

First thing is, as mentioned > 1,000,000 times above, tick the shared drive box in the main docker for windows application.

Next, simply use /host_mnt/

/host_mnt/<windows_drive>/<your_dir>

i.e. in my case

/host_mnt/c/xampp/htdocs/

I tried a variety of methods, it’s been quite confusing as I’ve been using Docker alongside Linux Subsystem for Windows, so initially I was referencing directories off of the linux box, but this is incorrect as even when running docker from the sub-system, it is only running as a client, so everything is relevant to the docker installation on the windows machine itself.

Here is my full docker-compose markup for better perspective:

version: '2'

services:
   db:
     build: ./mysql
     volumes:
       - db_data:/var/lib/mysql
     environment:
       MYSQL_ROOT_PASSWORD: root
   php:
    build: ./php
    ports:
      - '80:80'
    restart: always
    volumes:
       - /host_mnt/c/xampp/logs/:/var/log/apache2/
       - /host_mnt/c/xampp/htdocs/:/var/www/html/
    depends_on:
      - db
volumes:
    db_data:

Hope this helps someone!