【问题标题】:Issue in running docker on WSL2 Ubuntu 18 LTS在 WSL2 Ubuntu 18 LTS 上运行 docker 的问题
【发布时间】:2020-11-10 15:56:07
【问题描述】:

我的 Windows 10 机器上有 ubunto 18 LTS wsl2。

已经安装了 docker - 请在下面找到截图

现在启动 Docker 服务后,我尝试检查 docker 信息,但遇到以下错误。

我做了一些研究,发现了这篇文章 - Cannot connect to the Docker daemon at unix:/var/run/docker.sock. Is the docker daemon running?

正如这里所建议的,systemctl start docker 也尝试过,但是得到了System has not been booted with systemd as init system (PID 1). Can't operate. 的错误

还有一个建议是尝试sudo dockerd - 这导致以下日志

INFO[2020-07-21T14:45:02.918374600+05:30] [graphdriver] using prior storage driver: overlay2
WARN[2020-07-21T14:45:03.044702300+05:30] Your kernel does not support cgroup memory limit
WARN[2020-07-21T14:45:03.046625300+05:30] Unable to find cpu cgroup in mounts
WARN[2020-07-21T14:45:03.049054700+05:30] Unable to find blkio cgroup in mounts
WARN[2020-07-21T14:45:03.051115500+05:30] Unable to find cpuset cgroup in mounts
WARN[2020-07-21T14:45:03.053056000+05:30] mountpoint for pids not found
INFO[2020-07-21T14:45:03.056254900+05:30] Loading containers: start.
WARN[2020-07-21T14:45:03.108913100+05:30] Running iptables --wait -t nat -L -n failed with message: `iptables v1.6.1: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.`, error: exit status 3
INFO[2020-07-21T14:45:03.522988800+05:30] stopping event stream following graceful shutdown  error="<nil>" module=libcontainerd namespace=moby
INFO[2020-07-21T14:45:03.523923200+05:30] stopping healthcheck following graceful shutdown  module=libcontainerd
INFO[2020-07-21T14:45:03.524034200+05:30] stopping event stream following graceful shutdown  error="context canceled" module=libcontainerd namespace=plugins.moby
failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to create NAT chain DOCKER: iptables failed: iptables -t nat -N DOCKER: iptables v1.6.1: 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) 

继续我在上面的 iptable 问题上搜索,并按照论坛中的说明找到https://stackoverflow.com/questions/21983554,我尝试了sudo modprobe ip_tables,它给出了modprobe: FATAL: Module ip_tables not found in directory /lib/modules/4.4.0-18362-Microsoft

毕竟,如果我走在正确的轨道上,我需要一些指导。

【问题讨论】:

    标签: docker ubuntu-18.04 windows-subsystem-for-linux


    【解决方案1】:

    1.kill dockerd 进程(如果没有找到进程转到2) ps-辅助 | grep dockerd

    杀死 -9 DOCKERD_PROCESS_ID

    2.sudo dockerd &

    运行dockerd成功!

    【讨论】:

    • dockerd 还需要iptables 不存在,这个命令会失败
    • 我不知道哪个是代码,哪个是支持代码的注释。这使得这个答案没有帮助。
    猜你喜欢
    • 1970-01-01
    • 2020-12-11
    • 2020-08-16
    • 1970-01-01
    • 1970-01-01
    • 2016-08-29
    • 2018-12-14
    • 2021-05-20
    • 2021-03-25
    相关资源
    最近更新 更多