windows 子系统中如何使用docker

windows 子系统,即wsl ubuntu (windows subsystem linux)

step1:

在 windows 中,ubuntu 中都安装好docker

step2:

勾选Expose daemon 选项


image.png

step3:

将DOCKER_HOST写进wsl ubuntu (windows subsystem linux)环境变量
编辑文件,在最后一行添加 export DOCKER_HOST=tcp://localhost:2375

vi /etc/profile
添加好后,使环境变量生效
source /etc/profile

这时候 docker ps 就能看到在windows中已经启动的docker了

image.png

你可能感兴趣的:(windows 子系统中如何使用docker)