Error installing config file into container
Edit: I'm on windows.
I am experimenting with docker compose. I know I have to use a Dockerfile to copy the file to the container, but I want to solve it by installing the file because it is easier for my experimentation at the moment. I also want to take this as a learning experience in regards to what the problem is here.
Mine docker-compose.yml
looks like this:
version: "3"
services:
webserver:
image: nginx:latest
ports:
- "80:80"
volumes:
- ./webapp.conf:/etc/nginx/conf.d/default.conf
webapp:
image: wordpress:php7.1-fpm
on startup docker-compose up
I see the following error message:
PS C:\Users\daniel\Documents\Docker> docker-compose up
Removing docker_webserver_1
Recreating ed1b21e6939c_docker_webserver_1
docker_webapp_1 is up-to-date
ERROR: for webserver Cannot start service webserver: error while creating mount source path '/C/Users/daniel/Documents/Docker/webapp.conf': mkdir /C/Users/daniel/Documents: permission denied
ERROR: Encountered errors while bringing up the project.
What am I doing wrong.
source to share
(I added the same issue a few minutes ago.)
Make sure your docker is allowed to mount directory C:\Users\[redacted]\Documents\Docker
Configuration
In Windows client, you can configure docker to allow read / write on specific drives. This should fix your permissions issue.
Already set up?
In my case, it has already been selected. I unchecked the box and checked the disk again. Apply "change". This prompted me for the Windows password (which changed) and it worked again.
source to share