最近用win10弄了台nas,鉴于性能过剩的原因,于是开启了wls2玩玩docker。
在研究metabase的安装的时候要外挂载插件目录,发现docker -v挂载命令的写法与linux上的不同。google后发现了答案:
Performance is much higher when files are bind-mounted from the Linux filesystem, rather than remoted from the Windows host. Therefore avoid docker run -v /mnt/c/users:/users (where /mnt/c is mounted from Windows).
Instead, from a Linux shell use a command like docker run -v ~/my-project:/sourceswhere ~ is expanded by the Linux shell to $HOME.
例如:
我的metabase在linux上的挂载方式是:
docker run -v /home/metabase/plugins:/plugins metabase
注:/home/metabase/plugins
为本地目录
现在,metabase在win10上的挂载方式是:
docker run -v /mnt/c/users/bing/metabase/plugins:/plugins metabase
注:/mnt/c/users/bing/metabase/plugins
为本地目录, 换成正常路径则为:C:\Users\bing\metabase\plugins
参考: