deb: use `dh-sequence-installsysusers` instead of manual `postinst` to setup `docker` group

未关闭
#598 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
3/5
预计耗时
1-2 天
新手友好度
65/100
Issue 类型
重构
描述清晰度
描述清楚
活跃度
活跃
技术栈
debian, dockerfile
领域
devops

调研方向

Read the linked pull request discussions and inspect deb/common/control, deb/common/docker-ce.docker.sysusers, deb/common/docker-ce.postinst, and deb/common/rules. Check how the Debian packaging currently creates the docker group, then build and test the package to verify the sysusers sequence replaces the manual post-install setup. Done means the package creates the group through dh-sequence-installsysusers and retains the docker service name.

由索引模型根据 Issue 内容生成。

描述

relates to:

See https://github.com/docker/docker-ce-packaging/pull/1196#discussion_r2116353043 for more details;

So in theory, this should be enough:

$ git --no-pager diff --staged --irreversible-delete
diff --git a/deb/common/control b/deb/common/control
index e2438b9..48b9561 100644
--- a/deb/common/control
+++ b/deb/common/control
@@ -6,8 +6,9 @@ Build-Depends: bash,
                bash-completion,
                ca-certificates,
                cmake,
+               debhelper-compat (= 13),
                dh-apparmor,
-               debhelper-compat (= 12),
+               dh-sequence-installsysusers,
                gcc,
                git,
                libc-dev,
diff --git a/deb/common/docker-ce.docker.sysusers b/deb/common/docker-ce.docker.sysusers
new file mode 120000
index 0000000..eddc903
--- /dev/null
+++ b/deb/common/docker-ce.docker.sysusers
@@ -0,0 +1 @@
+../engine/contrib/systemd-sysusers/docker.conf
\ No newline at end of file
diff --git a/deb/common/docker-ce.postinst b/deb/common/docker-ce.postinst
deleted file mode 100755
index eeef6ca..0000000
diff --git a/deb/common/rules b/deb/common/rules
index a25eae2..3fd39ae 100755
--- a/deb/common/rules
+++ b/deb/common/rules
@@ -141,6 +141,10 @@ override_dh_installsystemd:
 	# use "docker" as our service name, not "docker-ce"
 	dh_installsystemd --name=docker
 
+override_dh_installsysusers:
+	# use "docker" as our service name, not "docker-ce"
+	dh_installsysusers --name=docker
+
 override_dh_shlibdeps:
 	dh_shlibdeps --dpkg-shlibdeps-params=--ignore-missing-info
 
主要语言
Dockerfile
星标
37
派生
42
平均合并
16 小时 53 分钟
30 天内合并 PR
30

环境准备

  • 提供 Dockerfile 或 Docker Compose 文件
  • 没有 Pull Request 模板
  • 阅读贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

docker/packaging 的其他 Issue

查看 docker/packaging 的全部 Issue

相似的 Issue

更多 DevOps Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。