Skip to content

feat: manage docker group with systemd-sysusers (carry #1187) #1195

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
May 27, 2025

Conversation

thaJeztah
Copy link
Member

Switches away from the groupadd postinstall commands to managing the docker group with sysusers.

This is a declarative way to create and manage users, better suited for the atomic distros such as Silverblue.

- What I did

- How I did it

- How to verify it

- Description for the changelog

deb, rpm packages: manage docker group with systemd-sysusers instead of post-install script.

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

@thaJeztah
Copy link
Member Author

With this PR;

apt-get -y  update && apt-get -y install ca-certificates curl
install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc
chmod a+r /etc/apt/keyrings/docker.asc
echo   "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null
apt-get -y update
apt install ./docker-ce_0.0.0~20250520085713.af09051-1~debian.13~trixie_arm64.deb

The docker.conf is installed in /etc/sysusers.d/docker.conf

ls -l /etc/sysusers.d
total 4
-rw-r--r-- 1 root root 235 May 20 11:03 docker.conf

https://manpages.debian.org/bookworm/debhelper/dh_installsysusers.1.en.html describes that dh_installsysusers would install this in /usr/lib/sysusers.d/docker.conf - is that the more correct location for this? @tianon @neersighted ?

@tianon
Copy link
Contributor

tianon commented May 21, 2025

If it's installed by a package, yes, absolutely.

Switches away from the groupadd postinstall commands to managing
the docker group with sysusers.

This is a declarative way to create and manage users, better suited
for the atomic distros such as Silverblue.

Signed-off-by: Robert Sturla <robertsturla@outlook.com>
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the carry_systemd_sysusers branch from 2edb46a to 8c5e99f Compare May 21, 2025 08:48
@thaJeztah
Copy link
Member Author

If it's installed by a package, yes, absolutely.

Updated to install in /usr/lib/sysusers.d/

I was also still trying to use the symlink approach, but didn't manage to get that working so far; #1196

@thaJeztah
Copy link
Member Author

@vvoland @tianon @neersighted ptal

Copy link
Contributor

@p5 p5 left a comment

Choose a reason for hiding this comment

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

Thank you for taking over this PR!
Work has got extremely busy lately and I've not had chance to do much else. I was going to take a look again today, then noticed this PR.

These changes all look great, and all make complete sense. The old PR had "test" code which I used while waiting for the moby/moby PR to merge, which you've cleared up.


I too couldn't figure out the Debian dh_installsysusers part, so did what I thought was the bare minimum to get something working, bypassing that.

@thaJeztah
Copy link
Member Author

Work has got extremely busy lately and I've not had chance to do much else.

No worries!!

I too couldn't figure out the Debian dh_installsysusers part, so did what I thought was the bare minimum to get something working, bypassing that.

Yeah, same; decided to keep it as a follow-up for now (but likely also requires #1202, which also seems to have issues still to look into).

@thaJeztah
Copy link
Member Author

@tianon @vvoland ptal 🤗

@thaJeztah thaJeztah requested review from vvoland and tianon-sso May 27, 2025 07:15
@vvoland vvoland merged commit 875b3d8 into docker:master May 27, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

manage docker group with systemd-sysusers
4 participants