rootless: properly support --net=host and localhost registries#47103
rootless: properly support --net=host and localhost registries#47103AkihiroSuda merged 1 commit intomoby:masterfrom
--net=host and localhost registries#47103Conversation
625ffe3 to
9110315
Compare
This comment was marked as resolved.
This comment was marked as resolved.
c93736a to
0cf5b8d
Compare
0cf5b8d to
b8d5d56
Compare
This comment was marked as duplicate.
This comment was marked as duplicate.
This comment was marked as resolved.
This comment was marked as resolved.
b8d5d56 to
b55597b
Compare
b55597b to
78e50bb
Compare
78e50bb to
09328ff
Compare
09328ff to
e140646
Compare
e140646 to
138dd4f
Compare
Assumed so, but Hyrum's Law may potentially apply 🤷♂️ |
|
Yeah, I think we should be able to ignore Hyrum for now; we'll see if there's a large outcry Oh! Let me put this on the v29.3.2 milestone; I think we'll be renaming that one (easier than "moving") |
thaJeztah
left a comment
There was a problem hiding this comment.
🙈 left some comments; let me know what you think. Could also use input from others 😅
| // For rootless + host netns, we can't mount sysfs. | ||
| // We can't (non-recursively) bind mount /sys, either. | ||
| // | ||
| // TODO: consider to just rbind /sys from the host with rro, | ||
| // when rro is available (kernel >= 5.12, runc >= 1.1). | ||
| // | ||
| // Relevant: https://github.com/moby/buildkit/blob/v0.12.4/util/rootless/specconv/specconv_linux.go#L15-L34 | ||
| // https://github.com/containerd/nerdctl/pull/2723 |
There was a problem hiding this comment.
Thanks for the comments with links; always useful as bread-crumb ❤️
Should we create a tracking-ticket for the TODO? (kernel-versions came up recently; we should probably look if we can do feature-detection if we don't have that yet, but also look what distros are still on < v5(.12)
There was a problem hiding this comment.
Yes, let's open a tracking ticket when this PR is merged
662078a to
6ead1b0
Compare
6ead1b0 to
920de6a
Compare
Now `dockerd-rootless.sh` launches RootlessKit with `--detach-netns` so as to run the daemon in the host network namespace. The libnetwork namespaces are allocated inside the "detached" netns (`$ROOTLESSKIT_STATE_DIR/netns`) that is associated with slirp4netns, vpnkit, pasta, etc., as the rootless daemon has no `CAP_NET_ADMIN` for the host network namespace. This will enable: - Accelerated (and deflaked) `docker pull`, `docker push`, `docker build`, etc - Proper support for `docker pull 127.0.0.1:.../...` - Proper support for `dockern run --net=host` See also: - rootless-containers/rootlesskit PR 379 - containerd/nerdctl PR 2723 NOTE: libnetwork contains code generated by Claude Code Signed-off-by: Akihiro Suda <[email protected]>
920de6a to
84aedb8
Compare
|
Merged, as the PR has been approved and the master branch is now thawed for v29.5. Docs PR: |
Now
dockerd-rootless.shlaunches RootlessKit with--detach-netnsso as to run the daemon in the host network namespace.
The libnetwork namespaces are allocated inside the "detached" netns
(
$ROOTLESSKIT_STATE_DIR/netns) that is associated with slirp4netns,vpnkit, pasta, etc., as the rootless daemon has no
CAP_NET_ADMINforthe host network namespace.
This will enable:
docker pull,docker push,docker build, etcdocker pull 127.0.0.1:.../...dockern run --net=hostSee also:
NOTE: libnetwork contains code generated by Claude Code
- What I did
docker pull,docker push,docker build, etcdocker pull 127.0.0.1:.../...dockern run --net=host- How I did it
Execute the rootless daemon in the host network namespace.
Prior to this PR, the daemon was executed in a network namespace created by RootlessKit.
- How to verify it
CI should be green
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)
🐧