Windows wsl 子系统 Ubuntu 或 debian 启动 Docker 时报错解决方法
报的错很恶心:
INFO[2023-09-24T18:23:55.515151300+08:00] containerd successfully booted in 0.048348s
INFO[2023-09-24T18:23:55.558664600+08:00] [graphdriver] using prior storage driver: overlay2
INFO[2023-09-24T18:23:55.559567400+08:00] Loading containers: start.
INFO[2023-09-24T18:23:55.560018000+08:00] falling back to default port range 49153-65535 error="open /proc/sys/net/ipv4/ip_local_port_range: no such file or directory"
WARN[2023-09-24T18:23:55.570949600+08:00] Could not load necessary modules for IPSEC rules: protocol not supported
WARN[2023-09-24T18:23:55.581362500+08:00] Could not load necessary modules for Conntrack: Running modprobe nf_conntrack failed with message: `modprobe: WARNING: Module nf_conntrack not found in directory /lib/modules/4.4.0-19041-Microsoft`, error: exit status 1
ERRO[2023-09-24T18:23:55.582620900+08:00] Failed to create bridge docker0 via netlink error="permission denied"
INFO[2023-09-24T18:23:55.585772600+08:00] stopping event stream following graceful shutdown error="<nil>" module=libcontainerd namespace=moby
INFO[2023-09-24T18:23:55.586921900+08:00] stopping healthcheck following graceful shutdown module=libcontainerd
INFO[2023-09-24T18:23:55.586959700+08:00] stopping event stream following graceful shutdown error="context canceled" module=libcontainerd namespace=plugins.moby
failed to start daemon: Error initializing network controller: error creating default "bridge" network: permission denied
然后各种查询,说删除 docker0 这个网络之类,但都不成功。又说是与 iptables 有关,要配置 /etc/docker/daemon.json
来禁用它,但还是不成功。
failed to start daemon: Error initializing network controller: Error creating default "bridge" network: permission denied
最终,只需要以管理员身份运行 wsl 即可!
即:以管理员身份打开 windows 的 cmd 窗口,然后再运行子系统,以上错误都不会再有了。
声明: 因编程语言版本更新较快,当前文章所涉及的语法或某些特性相关的信息并不一定完全适用于您当前所使用的版本,请仔细甄别。文章内容仅作为学习和参考,若有错误,欢迎指正。
开发者
专题·造轮子
Docker·热门
相关文章
-
docker-compose 与环境变量配置
11-05
-
利用 Harbor 创建自己的镜像仓库
06-27
-
设置自己的镜像仓库,以阿里云为例
06-27
-
常用的 docker 镜像源
06-24
-
docker-compose 报 Found orphan containers for this project
02-20