-
Notifications
You must be signed in to change notification settings - Fork 160
all: manage docker group with systemd-sysusers #1187
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -123,6 +123,12 @@ override_dh_auto_install: | |||||||||||
| install -D -p -m 0755 engine/contrib/dockerd-rootless-setuptool.sh debian/docker-ce-rootless-extras/usr/bin/dockerd-rootless-setuptool.sh | ||||||||||||
| # TODO: how can we install vpnkit? | ||||||||||||
|
|
||||||||||||
| # install systemd sysusers config | ||||||||||||
| mkdir -p debian/docker-ce/etc/sysusers.d | ||||||||||||
| echo "g docker -" >> debian/docker-ce/etc/sysusers.d/docker.conf | ||||||||||||
| chmod 0644 debian/docker-ce/etc/sysusers.d/docker.conf | ||||||||||||
| # install -D -p -m 0644 engine/contrib/systemd-sysusers/docker.conf debian/docker-ce/etc/sysusers.d/docker.conf | ||||||||||||
|
Comment on lines
+127
to
+130
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Moby PR was merged, so this can now use;
Suggested change
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should actually be a (dangling in Git) symlink and use debhelper: https://manpages.debian.org/bookworm/debhelper/dh_installsysusers.1.en.html
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (most/all of this section should be using dh_install too, but that's orthogonal) |
||||||||||||
|
|
||||||||||||
| override_dh_installinit: | ||||||||||||
| # use "docker" as our service name, not "docker-ce" | ||||||||||||
| dh_installinit --name=docker | ||||||||||||
|
|
||||||||||||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -84,6 +84,12 @@ install -D -p -m 0755 $(readlink -f engine/bundles/dynbinary-daemon/dockerd) ${R | |||||||||||||||
| install -D -p -m 0755 $(readlink -f engine/bundles/dynbinary-daemon/docker-proxy) ${RPM_BUILD_ROOT}%{_bindir}/docker-proxy | ||||||||||||||||
| install -D -p -m 0755 /usr/local/bin/docker-init ${RPM_BUILD_ROOT}%{_libexecdir}/docker/docker-init | ||||||||||||||||
|
|
||||||||||||||||
| # install systemd sysusers config | ||||||||||||||||
| mkdir -p ${RPM_BUILD_ROOT}%{_sysusersdir} | ||||||||||||||||
| echo "g docker -" >> ${RPM_BUILD_ROOT}%{_sysusersdir}/docker.conf | ||||||||||||||||
| chmod 0644 ${RPM_BUILD_ROOT}%{_sysusersdir}/docker.conf | ||||||||||||||||
| # install -D -p -m 0644 engine/contrib/systemd-sysusers/docker.conf ${RPM_BUILD_ROOT}%{_sysusersdir}/docker.conf | ||||||||||||||||
|
Comment on lines
+87
to
+91
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same here
Suggested change
|
||||||||||||||||
|
|
||||||||||||||||
| # install systemd scripts | ||||||||||||||||
| install -D -p -m 0644 engine/contrib/init/systemd/docker.service ${RPM_BUILD_ROOT}%{_unitdir}/docker.service | ||||||||||||||||
| install -D -p -m 0644 engine/contrib/init/systemd/docker.socket ${RPM_BUILD_ROOT}%{_unitdir}/docker.socket | ||||||||||||||||
|
|
@@ -100,14 +106,12 @@ mkdir -p ${RPM_BUILD_ROOT}/etc/docker | |||||||||||||||
| %{_libexecdir}/docker/docker-init | ||||||||||||||||
| %{_unitdir}/docker.service | ||||||||||||||||
| %{_unitdir}/docker.socket | ||||||||||||||||
| %{_sysusersdir}/docker.conf | ||||||||||||||||
| %{_mandir}/man*/* | ||||||||||||||||
| %dir /etc/docker | ||||||||||||||||
|
|
||||||||||||||||
| %post | ||||||||||||||||
| %systemd_post docker.service | ||||||||||||||||
| if ! getent group docker > /dev/null; then | ||||||||||||||||
| groupadd --system docker | ||||||||||||||||
| fi | ||||||||||||||||
|
|
||||||||||||||||
| %preun | ||||||||||||||||
| %systemd_preun docker.service docker.socket | ||||||||||||||||
|
|
||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Effectively, this is now equivalent to;
Or... basically; we don't have anything custom remaining now, so I think we can remove the
docker-ce.postinstfile altogether.I just tried if it's happy if the file isn't there (because the
#DEBHELPER#comment below is what's used to insert generated bits, and it looks like it is; removing the file will still produce a postinst script, just with thecaseremoved (which I think doesn't add real value now?) cc @tianon to make sure I'm not hallucinating 😂 ❤️There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct if we're not doing anything else, we should just drop the file completely 🚀