【发布时间】:2022-01-03 14:49:50
【问题描述】:
我正在尝试关注: https://dev.to/_nicolas_louis_/how-to-run-docker-on-windows-without-docker-desktop-hik 为了在 Windows 的 wsl2 上使用 docker。
我可以通过这个调用启动一个 docker 容器:
docker -H 127.0.0.1 run --rm hello-world
但是,当我通过以下方式获取 IP 地址时:
echo `ifconfig eth0 | grep -E "([0-9]{1,3}.){3}[0-9]{1,3}" | grep -v 127.0.0.1 | awk '{ print $2 }' | cut -f2 -d:`
并尝试使用以下命令启动容器:
docker -H 172.26.110.78 run --rm hello-world
我收到以下错误:
docker: Cannot connect to the Docker daemon at tcp://172.26.110.78:2375. Is the docker daemon running?.
显然,Ping 有效,docker 守护进程运行。
我可以做些什么来解决这个问题?
【问题讨论】:
标签: docker windows-subsystem-for-linux wsl-2