Tks all, idk why, but now its working
I am learning to use docker. I am trying to 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 the imageID I tried on another disk and tried many other ways but it is still not working. Can you help me?
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
See: Path conversion in Windows
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