Skip to content

dockerd-rootless.sh: check containerd-rootless.sh conflict#52175

Open
AkihiroSuda wants to merge 1 commit intomoby:masterfrom
AkihiroSuda:fix-52171
Open

dockerd-rootless.sh: check containerd-rootless.sh conflict#52175
AkihiroSuda wants to merge 1 commit intomoby:masterfrom
AkihiroSuda:fix-52171

Conversation

@AkihiroSuda
Copy link
Member

@AkihiroSuda AkihiroSuda commented Mar 14, 2026

- What I did
dockerd-rootless.sh: check containerd-rootless.sh conflict

fixes #52171

Prior to this fix, Rootless Docker could fail with cryptic errors when Rootless containerd is running too

- How I did it
Check if $XDG_RUNTIME_DIR/containerd-rootless exists

- How to verify it

$ containerd-rootless-setuptool.sh install
$ dockerd-rootless-setuptool.sh install
[ERROR] dockerd-rootless.sh conflicts with containerd-rootless.sh. Stop containerd-rootless.sh if it's running, and remove /run/user/1000/containerd-rootless if it still exists.

- Human readable description for the release notes

dockerd-rootless.sh: check containerd-rootless.sh conflict

- A picture of a cute animal (not mandatory but encouraged)

Fix issue 52171

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
@AkihiroSuda AkihiroSuda added impact/changelog kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. kind/bugfix PR's that fix bugs and removed kind/bug Bugs are bugs. The cause may or may not be known at triage time so debugging may be needed. labels Mar 14, 2026
Comment on lines +111 to +115
: "${CONTAINERD_ROOTLESS_ROOTLESSKIT_STATE_DIR:=$XDG_RUNTIME_DIR/containerd-rootless}"
if [ -e "$CONTAINERD_ROOTLESS_ROOTLESSKIT_STATE_DIR" ]; then
# https://github.com/moby/moby/issues/52171
# Hard requirement, not bypassable with --force
ERROR "dockerd-rootless.sh conflicts with containerd-rootless.sh. Stop containerd-rootless.sh if it's running, and remove $CONTAINERD_ROOTLESS_ROOTLESSKIT_STATE_DIR if it still exists."
Copy link
Member

@thaJeztah thaJeztah Mar 15, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm wondering;

  • Does the containerd-rootless.sh script need a similar check?
  • Alternatively; should they actually conflict? Or could / should we (somehow) consider that if containerd is started as part of dockers-rootless.sh that it should spin up its own instance?

Not 100% sure what's best; either

  • match the "containerd as child process of dockerd" (as we do when starting dockerd manually, so not using a system-service)
  • consider containerd already running (rootless) to be "system containerd service is running, so use that instance"

Just thinking out loud here; open to suggestions / thoughts!

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the containerd-rootless.sh script need a similar check?

Yes. Will open a PR there later.

Alternatively; should they actually conflict? Or could / should we (somehow) consider that if containerd is started as part of dockers-rootless.sh that it should spin up its own instance?

They shouldn't do, but they do currently.
Probably dockerd-rootless.sh should join the namespaces created by containerd-rootless.sh, but it not trivial to implement and test such a complicated configuration.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean "containerd" namespace (so it cannot create a new (moby.xx?) namespace if it's already running / initialized?), or otherwise?

I was considering if it treated it as a "system containerd already running, then use it, otherwise create our own ("managed") instance; any way that's possible?

Copy link
Member Author

@AkihiroSuda AkihiroSuda Mar 20, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I meant the kernel namespaces ( e.g. mntns) crated by containerd-rootless.sh

@AkihiroSuda AkihiroSuda requested a review from thaJeztah March 18, 2026 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

dockerd-rootless[-setuptool].sh conflicts with containerd-rootless[-setuptool].sh, but no error is printed during installation

2 participants