wsl1中可以尝试这样mount
docker run --rm -it --privileged \
--mount type=bind,source=/mnt,target=/mnt \
--mount type=bind,source=/run/WSL,target=/run/WSL \
--mount type=bind,source=/etc/passwd,target=/etc/passwd,readonly \
--mount type=bind,source=/etc/group,target=/etc/group,readonly \
--mount "type=bind,source=$HOME,target=$HOME" \
--workdir "$HOME" \
-u $(id -u):$(id -g) \
--env WSLENV="${WSLENV}" \
--env WSL_DISTRO_NAME="${WSL_DISTRO_NAME}" \
--env WSL_INTEROP="${WSL_INTEROP}" \
--env WT_PROFILE_ID="${WT_PROFILE_ID}" \
--env WT_SESSION="${WT_SESSION}" \
ubuntu \
sh -c '/mnt/c/Windows/system32/notepad.exe'
wsl2中尝试这样mount
docker run --rm -it --privileged \
--mount type=bind,source=/init,target=/init \
--mount type=bind,source=/mnt,target=/mnt \
--mount type=bind,source=/run/WSL,target=/run/WSL \
--env WSL2_GUI_APPS_ENABLED="${WSL2_GUI_APPS_ENABLED}" \
--env WSL_INTEROP="${WSL_INTEROP}" \
--env PULSE_SERVER="${PULSE_SERVER}" \
ubuntu \
bash -c '"/mnt/c/Support Files/notepad.exe"'
在wsl的docker中调用windows下程序
©著作权归作者所有,转载或内容合作请联系作者
- 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
- 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
- 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
推荐阅读更多精彩内容
- 最近因为python爬虫学习要借助Splash进行js渲染服务,Splash又要使用到Docker,而我却没有li...
- 参考:https://github.com/Microsoft/WSL/issues/2468 Presuming...
- 参考: Win10内置Ubuntu,完美使用Docker in Windows 现在Win10下用WSL(Wind...
- 文章原发表于我的博客 5+1Blog 516wjy.xyz:516[https://516wjy.xyz:516/...