我试图在WSL上运行Docker失败.我已按照install Docker on Ubuntu给出的步骤在WSL上安装了Docker但是当我执行docker ps时出现以下错误:
docker ps
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
看着码头日志我发现了这个:
level=warning msg="Running modprobe nf_nat Failed with message: `modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.0-43-Microsoft/modules.dep.bin'\nmodprobe: WARNING: Module nf_nat not found in directory /lib/modules/4.4.0-43-Microsoft`,error: exit status 1"
time="2017-12-28T12:07:23.227671600+01:00" level=warning msg="Running modprobe xt_conntrack Failed with message: `modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.4.0-43-Microsoft/modules.dep.bin'\nmodprobe: WARNING: Module xt_conntrack not found in directory /lib/modules/4.4.0-43-Microsoft`,error: exit status 1"
Error starting daemon: Error initializing network controller: error obtaining controller instance: Failed to create NAT chain: iptables Failed: iptables -t nat -N DOCKER: iptables v1.6.0: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
(exit status 3)
知道如何在WSL上运行Docker?
最佳答案
最后,我可以轻松地在WSL上运行Docker:首先需要在Windows上安装和运行Docker Engine,然后在Ubuntu bash上创建一个指向Windows可执行文件的符号链接:
原文链接:https://www.f2er.com/docker/435939.htmlsudo ln -s /mnt/c/Program\ Files/Docker/Docker/resources/bin/docker.exe /usr/bin/docker
此链接有效,因为从Windows 10 Creators Update版本可以从Bash运行Windows可执行文件.如果Windows版本是Windows 10 Creators Update之前的版本,则可以尝试使用solution explained in this blog