Skip to content

Dev container: try to load kernel module ip6_tables#47960

Merged
tianon merged 1 commit intomoby:masterfrom
robmry:dev_container_ip6_tables
Jun 13, 2024
Merged

Dev container: try to load kernel module ip6_tables#47960
tianon merged 1 commit intomoby:masterfrom
robmry:dev_container_ip6_tables

Conversation

@robmry
Copy link
Contributor

@robmry robmry commented Jun 12, 2024

- What I did

On an nftables host, the ip6_tables kernel module may not be loaded, but it needs to be for dockerd to run (with ip6tables now enabled by default).

Related to:

- How I did it

If ip6tables doesn't work, try the dind official image's trick for loading the module using ip link show.

- How to verify it

On a Debian 12.5 host, with nftables - dockerd starts in a dev container without this fix (following #47918), but it's not possible to create a --ipv6 network. This change sorts it out.

In a dev container on MacOS, it doesn't do anything (as expected).

- Description for the changelog

@robmry robmry added area/networking Networking kind/bugfix PR's that fix bugs area/networking/ipv6 Networking labels Jun 12, 2024
@robmry robmry added this to the 27.0.0 milestone Jun 12, 2024
@robmry robmry self-assigned this Jun 12, 2024
@robmry robmry requested a review from tianon as a code owner June 12, 2024 13:28
@robmry robmry requested a review from akerouanton June 12, 2024 13:28
On an nftables host, the ip6_tables kernel module may not be loaded,
but it needs to be for dockerd to run (with ip6tables now enabled by
default).

If ip6tables doesn't work, try the dind official image's trick for
loading the module using "ip link show".

Signed-off-by: Rob Murray <[email protected]>
@robmry robmry force-pushed the dev_container_ip6_tables branch from fbac0e3 to 44d00e3 Compare June 12, 2024 13:34
@thaJeztah
Copy link
Member

Would it make sense to put this in a separate file (contrib/.. or hack/..), similar to how the official DIND image uses it, and to copy that into the dev container? https://github.com/docker-library/docker/blob/5cfa200f9f2bb4486f046078fe4243d3ed6af593/modprobe.sh#L4

In that case, the DIND image could even fetch it together with the DIND script; https://github.com/docker-library/docker/blob/5cfa200f9f2bb4486f046078fe4243d3ed6af593/Dockerfile-dind.template#L80-L81

cc @tianon any thoughts?

@tianon tianon merged commit b5bc841 into moby:master Jun 13, 2024
@tianon
Copy link
Member

tianon commented Jun 13, 2024

Discussed Seb's questions in a maintainers meeting -- we could put it in contrib/, but I don't think there's a huge benefit to doing so (it certainly wouldn't make life any "easier" for the official dind image).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/networking/ipv6 Networking area/networking Networking kind/bugfix PR's that fix bugs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants