docker-ce fails to start on AlmaLinux/RHEL 10 due to missing xt_addrtype module now that iptables no longer pulls in kernel-modules-extra unconditionally

未关闭 适合新手
#591 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
74/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
冷清
技术栈
docker, linux

调研方向

从 rpm/SPECS/docker-ce.spec 开始,检查如何为列出的 RHEL 系目标选择软件包依赖项。确认对 iptables 和内核模块的现有处理方式,然后查看 RPM spec 的构建或验证说明。当这些目标明确依赖 kernel-modules-extra 且软件包元数据通过验证时,即为完成。

由索引模型根据 Issue 内容生成。

描述

Environment:
  • OS: AlmaLinux 10.2
  • Docker version: Docker version 29.6.2, build dfc4efb
  • iptables: iptables-nft-1.8.11-15.el10_2.x86_64
Description:

dockerd fails to start with:

failed to start daemon: Error initializing network controller: error obtaining controller instance: failed to register "bridge" driver: failed to add jump rules to ipv4 NAT table: failed to append jump rules to nat-PREROUTING: (COMMAND_FAILED: '/usr/sbin/iptables -t nat -A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER' failed: Warning:
Extension addrtype revision 0 not supported, missing kernel module?

Root cause:

The addrtype match requires the xt_addrtype kernel module, provided by the kernel-modules-extra package on RHEL-family distros. Until recently, kernel-modules-extra was pulled in automatically as an unconditional Recommends of iptables-nft, so it was present on any system with Docker installed, even though docker-ce itself never declared it as a dependency.

That changed upstream in iptables 1.8.11-15.el10:

  • spec: Recommend kernel-modules-extra only if no other
    recommendation applies (Phil Sutter) [RHEL-186232]
    Resolves: RHEL-186232

Source: https://git.almalinux.org/rpms/iptables/commit/bdfc71a038368010b31ac9ceb282ba4b23323455

With this change, kernel-modules-extra is no longer reliably installed as a side effect of installing iptables-nft. Since docker-ce.spec does not list kernel-modules-extra as a Requires or Recommends itself, fresh installs of Docker on updated RHEL 10 / AlmaLinux 10 / Rocky 10 systems can now fail to start with the error above, depending on the exact iptables package version and what else is installed on the host.

Requested fix:

Add an explicit Requires (or at minimum Recommends) on kernel-modules-extra in rpm/SPECS/docker-ce.spec for RHEL-family targets (rhel-9, rhel-10, centos-9, centos-10), since dockerd's default bridge network setup depends on the addrtype match and can no longer assume it will be pulled in transitively via iptables.

Workaround in the meantime:

dnf install kernel-modules-extra
systemctl restart docker.service

主要语言
Dockerfile
星标
37
派生
42
平均合并
16 小时 53 分钟
30 天内合并 PR
30

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

docker/packaging 的其他 Issue

查看 docker/packaging 的全部 Issue

相似的 Issue

更多 Build System Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。