I recently upgraded my Docker Toolbox on Windows 10, and now my volume mounts no longer work. I've tried everything. Here is the current mount path:
volumes:
- C:\Users\Joey\Desktop\backend:/var/www/html
I receive an invalid bind mount error.
I recently upgraded my Docker Toolbox on Windows 10, and now my volume mounts no longer work. I've tried everything. Here is the current mount path:
volumes:
- C:\Users\Joey\Desktop\backend:/var/www/html
I receive an invalid bind mount error.
Is this is services section? You do now need it in the volume section, so if you had it just remove it.
2. execute following command
Set path in docker compose file as shown below
File copied to windows
It seems you are using an absolute path located inside
C:\Users
dir, that didn't work for me too, if you are usingDocker-Toolbox
see below.Overview
Forwarding the
./
relative path involumes
section will automatically get resolved bydocker-compose
to the directory containingdocker-compose.yml
file (for example, if your project is in%UserProfile%/my-project
then./:/var/www/html
gets/c/Users/my-name/my-project:/var/www/html
).The problem is that currently (using
DockerToolbox-19.03.1
) only the/c/Users
directory gets shared with the Virtual-Machine (toolbox putsdocker
itself in the VM, which means it has no access to your file system, except mounted shared-directories).Conclusion
So, basically placing your project there (
C:\Users\YOUR_USER_NAME
) should make./
work. But not even that worked for me, and we ended up with below_prepare.sh
script:Usage:
docker-compose.yml
file.C:\Users
dir).Note:
docker-compose
being required.docker system prune
to free disk-space (or simply adddocker system prune --force
to the above script, on a new line right aftermount
command).I faced with same issue (I'm using Docker Desktop).
My steps were:
1) Place your folder under drive "C"
2) Open "Settings" in Docker Desktop -> "Shared Drives" -> "Reset Credentials" -> select drive "C" -> "Apply"
3) Open terminal and run (as proposed by Docker Desktop):
docker run --rm -v c:/Users:/data alpine ls /data
4) Open your
docker-compose.yml
and update path in-volumes
:5) restart docker container
I think you have to set
COMPOSE_CONVERT_WINDOWS_PATHS=1
, see here.Docker Machine should do it automatically: https://github.com/docker/machine/pull/3830