安装 docker

安装 docker

大家好,我在 ubuntu 上安装 docker 时遇到了问题,即使以 root 用户身份也无法启动 docker 守护进程,这是我收到的错误:

INFO[2020-12-18T15:31:10.428736900Z] stopping healthcheck following graceful shutdown  module=libcontainerd
INFO[2020-12-18T15:31:10.428746900Z] stopping event stream following graceful shutdown  error="context canceled" module=libcontainerd namespace=plugins.moby
DEBU[2020-12-18T15:31:10.431359000Z] received signal                               signal=terminated
DEBU[2020-12-18T15:31:10.438869400Z] sd notification                               error="<nil>" notified=false state="STOPPING=1"
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?)

root@COBLBHG01:/usr/bin# lsmod | grep nf_nat
libkmod: ERROR ../libkmod/libkmod-module.c:1657 kmod_module_new_from_loaded: could not open /proc/modules: No such file or directory
Error: could not get list of modules: No such file or directory

答案1

根据输出,lsmod我假设您正在 Windows 上使用 WSL v1。它是 Linux 的模拟,不使用 Linux 内核。

微软已经发布了在虚拟机内运行完整 Linux 系统的 WSLv2。请参阅Microsoft 文档关于如何升级到 WSLv2。

相关内容