Some files not visible and other visible as folders after adding Docker volume

懵懂的女人 提交于 2019-12-24 19:31:48

问题


I couldn't start container because of some issues with volumes so I tried this to make sure I understand how volumes work. And there is something strange that is happening here. Two files should be present in /data directory but instead, I see one folder named as one of the files on the source machine. I'm doing this on Windows 10.

PS C:\Users\Piotrek\source\repos\fluentd> dir


    Directory: C:\Users\Piotrek\source\repos\fluentd


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
-a----       06.01.2019     18:50              7 abc.txt
-a----       06.01.2019     18:50             80 test.conf


PS C:\Users\Piotrek\source\repos\fluentd> docker run -ti --rm -v ${PWD}:/data ubuntu ls -alR /data
/data:
total 4
drwxr-xr-x 3 1000 root   60 Jan  6 16:48 .
drwxr-xr-x 1 root root 4096 Jan  6 17:53 ..
drwxr-xr-x 2 1000 root   40 Jan  6 16:48 test.conf

/data/test.conf:
total 0
drwxr-xr-x 2 1000 root 40 Jan  6 16:48 .
drwxr-xr-x 3 1000 root 60 Jan  6 16:48 ..

回答1:


Problem solved. I went to Docker settings and under "Shared Drives" I clicked Reset Credentials.

I have enabled drive sharing some time ago but after that I changed password - to no password. Looks like Docker doesn't ask you to enable drive sharing again when your password is empty. It does when you change password, but not to empty one.



来源:https://stackoverflow.com/questions/54064416/some-files-not-visible-and-other-visible-as-folders-after-adding-docker-volume

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!