Docker Community Forums

Share and learn in the Docker community.

How to Mount a windows share into a Docker Compose

Dear Forum,
sorry for my bad English and i think for you all a easy question, but i am new in Docker an i try to build an Wordpress from an example and it didn’t work!
I am using Docker in Windows with the Linux Container Settings and with experimental features!
I tried to build this:

#Datei: Wordpress/docker-compose.yml

version: ‘3.1’
services:
nginx:
image: nginx:latest
volumes:
- ./default.conf:/etc/nginx/conf.d/default.conf
- webdata:/var/www/html
ports:
- 8080:80
wordpress:
image: wordpress:fpm-alpine
restart: unless-stopped
volumes:
- webdata:/var/www/html
environment:
WORDPRESS_DB_HOST: mariadb
WORDPRESS_DB_NAME: dockerbuch
WORDPRESS_DB_USER: dockerbuch
WORDPRESS_DB_PASSWORD: johroo2zaeQu

mariadb:
image: mariadb:10
restart: unless-stopped
environment:
MYSQL_ROOT_PASSWORD: eengi7suXeut
MYSQL_DATABASE: dockerbuch
MYSQL_USER: dockerbuch
MYSQL_PASSWORD: johroo2zaeQu

volumes:
webdata:

Here are my Questions!

  1. I have a SSD with the Letter D: it is a share in Docker! In this drive i have build a Folder D:/Docker/wepapp2/nginx/default.conf, when i use docker-compose up, the maria db and the wordpress are running but the nginx not
    What must I do to mount the shared folder nginx into the nginx?

  2. I my own studies i build a mariadb and build a folder on the drive d, but it didn’t work, when i delete the mount and the docker use the mount in the Container it works, what must i do to use it on the Host Drive?

Back to Question 1:
Can i use a Dockerfile call in the Docker-Compose.yml, with a volume oder mount point from windows in the Dockerfile?

What must i do?

Thank you