mac docker volume mount using osxfs not working

假如想象 提交于 2020-05-13 12:17:32

问题


Docker Desktop for Mac started using osxfs for supporting volume mounting on MacOS. According to their page, a command like this should mount the ~/Desktop directory to the docker container:

docker run -it -v ~/Desktop:/Desktop r-base bash

Although I do see a Desktop directory as expected, its contents are empty:

root@80cb534e4eeb:/# ls
bin  boot  Desktop  dev  etc  home  lib  lib64  media  mnt  opt  proc  root  run  sbin  srv  sys  tmp  usr  var
root@80cb534e4eeb:/# ls Desktop/
root@80cb534e4eeb:/# exit
exit 

while there are definitely files in the Desktop directory locally

Users-MacBook-Pro:~ user$ ls Desktop/
Screen Shot 2019-03-25 at 10.34.58.png      Screen Shot 2019-03-25 at 22.26.10.png      Screen Shot 2019-03-27 at 07.34.55.png
Screen Shot 2019-03-25 at 10.35.59.png      Screen Shot 2019-03-25 at 22.26.11.png      Screen Shot 2019-03-28 at 15.14.48.png
Screen Shot 2019-03-25 at 22.26.08.png      Screen Shot 2019-03-25 at 22.47.32.png      Screen Shot 2019-04-05 at 09.26.12.png
Screen Shot 2019-03-25 at 22.26.10 1.png    Screen Shot 2019-03-27 at 07.34.33.png 

The /Users directory should be accessible according to the Preferences window. Seems like something is wrong with the docker configuration, but I haven't found any similar issues reported yet. Most issues related to osxfs are about IO performance. Any ideas on how to further solve/investigate this issue?


回答1:


Docker factory reset in the preferences fixed the issue but the root cause is still unknown. One way of troubleshoot this kind of issues is to volume mount the root of the linux VM used by Docker for mac and poke around. This can be done with:

docker run --rm -v /:/vm_root --entrypoint=sh alpine -c 'ls -l /vm_root/<path in macOS>'


来源:https://stackoverflow.com/questions/55667800/mac-docker-volume-mount-using-osxfs-not-working

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