Tks all, idk why, but now its working
I learn to use docker. I try mount a host directory in a Docker container: >docker run -it -v /Users/Kell/Desktop/data:/home/data 77
And this is error: docker: Error response from daemon: error while creating mount source path '/Users/Kell/Desktop/data': mkdir /Users: file exists.
**I use windows and docker 20.10.12, 77 is imageID ** I tried in another disk and tried many ways but still not working. Can u help me ?
CodePudding user response:
If you learning docker from scratch it is recommended to use --mount
and not -v
anymore: Mount > v
The syntax of --mount
and -v
differs, so here you' find both: How to mount
Path style in Windows depends on the console you are using. Some are just working in one and not in another.
Windows-Style: docker run --rm -ti -v C:\Users\user\work:/work alpine
Pseudo-Linux-Style in Windows: docker run --rm -ti -v /c/Users/user/work:/work alpine
as well as //c/
Inside WSL: docker run --rm -ti -v /mnt/c/Users/user/work:/work alpine