Skip to content

openrc: allow customizing containerd service name #50156

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 11, 2025

Conversation

gagara
Copy link
Contributor

@gagara gagara commented Jun 8, 2025

- What I did
Added an option to customize containerd service name which is a dependency for docker. This is required in case we need to run several instances of docker along with dedicated instance of containerd service.

- How I did it
Added and extra config variable CONTAINERD_SVC. Existing behavior preserved by using respective default.

- How to verify it
On Gentoo use this fix for containerd.

  1. Create separate containerd and docker services:
ln -rs /etc/init.d/containerd{,-test}
ln -rs /etc/init.d/docker{,-test}
  1. Configure containerd service by creating /etc/conf.d/containerd-test with content:
containerd_socket_address="/run/containerd-test/containerd-test.sock"
command_args="--root=/var/lib/containerd-test --state=/run/containerd-test --address=${containerd_socket_address:-/run/containerd/containerd.sock}"
  1. Configure docker service by creating /etc/conf.d/docker-test with content:
CONTAINERD_SVC="containerd-test"
DOCKER_OPTS="--data-root=/var/lib/docker-test --exec-root=/var/run/docker-test --host=unix:///var/run/docker-test.sock --containerd=/run/containerd-test/containerd-test.sock"
  1. Start docker:
/etc/init.d/docker-test start

Expected result:
Respective containerd-test service should start up automatically.
Both containerd-test and docker-test services should work in parallel with standard containerd and docker services.

- Human readable description for the release notes

Allow customizing containerd service name for OpenRC

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

@@ -18,7 +18,7 @@ rc_ulimit="${DOCKER_ULIMIT:--c unlimited -n 524288 -u unlimited}"
retry="${DOCKER_RETRY:-TERM/60/KILL/10}"

depend() {
need containerd
need ${CONTAINERD_SVC:-containerd}
Copy link
Contributor

Choose a reason for hiding this comment

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

silly question (I'm not familiar with OpenRC):

A custom containerd instance will probably listen on a socket under a non-standard path, so dockerd will also need to know the socket path (via --containerd).

I assume it's up to the administrator to do it via DOCKER_OPTS?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes. There is sample configuration provided in step 3.
Additionally, for Gentoo, there is respective PR for containerd https://github.com/gentoo/gentoo/pull/42251/files to run it on custom socket address.

Copy link
Contributor

@vvoland vvoland left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@vvoland vvoland added this to the 28.2.3 milestone Jun 11, 2025
@vvoland vvoland merged commit d371ea1 into moby:master Jun 11, 2025
163 of 166 checks passed
@vvoland vvoland modified the milestones: 28.2.3, 28.3.0 Jun 11, 2025
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.

2 participants