I'm trying to start a project in Docker (directly from the Debian distro) in Windows 10 and getting this error:
$ docker compose up -d
[+] Running 0/0
⠋ Container core_php74_1 Creating 0.0s
Error response from daemon: path /home/me/path/to/project is mounted on / but it is not a shared mount.
How to make the mounted path /home/me/path/to/project
a shared mount?
In order to share Windows folders with Docker containers, you first need to configure the "Shared Drives" option in Docker settings. Once the Shared Drives option is configured, you can mount any folder on shared drives with the "-v" (volume) flag.
To share Docker images, you have to use a Docker registry. The default registry is Docker Hub and is where all of the images we've used have come from. A Docker ID allows you to access Docker Hub which is the world's largest library and community for container images. Create a Docker ID for free if you don't have one.
I got the same error after updating docker for desktop to 3.5.2 (66501). I have created volumes with trailing slashes in my docker-compose.yml
. I removed them to fix the problem.
Change
volumes:
- ./:/app/
- ./another/folder:/folder/
To
volumes:
- ./:/app
- ./another/folder:/folder
You can NOT mount into docker to "/" In your docker-compose.yml must be this lines or similar for windows :
volumes:
- /home/me/path/to/project:/path/in/image
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With