Windows10上想在wsl中使用docker最简单的方法就是先在win10上安装docker,然后在wsl中通过docker cli调用docker。(直接在wsl中安装的话会有各种问题).。
win10安装docker部分略过,直接下载安装就行。需要注意的是如果是win10家庭版,必须开启wsl 2才能安装docker。
打开docker配置,勾选“Expose daemon on tcp://localhost:2375 without TLS ”
安装docker cli
apt-get install docker.io
在shell的配置文件中添加
export DOCKER_HOST=tcp://127.0.0.1:2375
打开docker配置,勾选“Use the WSL 2 based engine ”
打开 “resources” - “WSL Integration” 勾选 “Enable integration with my default WSL distro ” 并选择需要连接docker的子系统
Powered by Froala Editor
发表评论 (对文章评论)