From 53319fda9a4574b4312e9a243941a2a3c786021e Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 3 Nov 2026 12:50:38 +0100 Subject: [PATCH] deb: stop forcing xz compression instead of zstd This override was originally added in [docker-ce-packaging@0f4c193][1]. At the time, our deploy pipeline used `dpkg-sig` to sign individual packages to allow them to be verified when installing offline. The override was added because Ubuntu 21.10 switched the default compression for .deb packages to use zstd, which is not compatible with `dpkg-sig`. Given that dpkg-sig has not received updates since 2006 and now removed [2], we stopped using it and stopped signing individual packages, so we can remove the override and use the defaults as used by the distro. Before: docker buildx bake pkg-docker-engine-ubuntu2604 --set pkg-docker-engine-ubuntu2604.platforms=linux/arm64 ls -l ./bin/pkg/docker-engine/ubuntu2604/linux_arm64/ubuntu/resolute/arm64/ total 61720 -rw-r--r--@ 1 thajeztah staff 7719 Nov 3 13:02 docker-ce_0.0.0~20261103082347~b1bf127-1~ubuntu.26.04~resolute_arm64.buildinfo -rw-r--r--@ 1 thajeztah staff 1942 Nov 3 13:02 docker-ce_0.0.0~20261103082347~b1bf127-1~ubuntu.26.04~resolute_arm64.changes -rw-r--r--@ 1 thajeztah staff 21099564 Nov 3 13:02 docker-ce_0.0.0~20261103082347~b1bf127-1~ubuntu.26.04~resolute_arm64.deb -rw-r--r--@ 1 thajeztah staff 9130404 Nov 3 13:02 docker-ce-rootless-extras_0.0.0~20261103082347~b1bf127-1~ubuntu.26.04~resolute_arm64.deb After: docker buildx bake pkg-docker-engine-ubuntu2604 --set pkg-docker-engine-ubuntu2604.platforms=linux/arm64 ls -l ./bin/pkg/docker-engine/ubuntu2604/linux_arm64/ubuntu/resolute/arm64/ total 67864 -rw-r--r--@ 1 thajeztah staff 7719 Nov 3 13:05 docker-ce_0.0.0~20261103082347~b1bf127-1~ubuntu.26.04~resolute_arm64.buildinfo -rw-r--r--@ 1 thajeztah staff 1942 Nov 3 13:05 docker-ce_0.0.0~20261103082347~b1bf127-1~ubuntu.26.04~resolute_arm64.changes -rw-r--r--@ 1 thajeztah staff 24165166 Nov 3 13:05 docker-ce_0.0.0~20261103082347~b1bf127-1~ubuntu.26.04~resolute_arm64.deb -rw-r--r--@ 1 thajeztah staff 9821436 Nov 3 13:05 docker-ce-rootless-extras_0.0.0~20261103082347~b1bf127-1~ubuntu.26.04~resolute_arm64.deb For Ubuntu 26.04 (arm64), this increases the combined package size from 30.23 MB to 33.99 MB (+12.4%), but significantly reduces extraction time and CPU usage. Benchmark results for docker-ce (5 runs, median): xz zstd Extraction 0.550s 0.209s User CPU 1.215s 0.126s System CPU 0.438s 0.118s This reduces extraction wall time by approximately 62%, while also reducing CPU usage considerably. [1]: https://github.com/docker/docker-ce-packaging/commit/0f4c193dfaf6bcb1d4d6c07470cd4f67a9a146d0 [2]: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=995113 Signed-off-by: Sebastiaan van Stijn --- pkg/agent/deb/rules | 5 ----- pkg/buildx/deb/rules | 5 ----- pkg/compose/deb/rules | 5 ----- pkg/containerd/deb/rules | 5 ----- pkg/credential-helpers/deb/rules | 5 ----- pkg/docker-cli/deb/rules | 5 ----- pkg/docker-engine/deb/rules | 5 ----- pkg/model/deb/rules | 5 ----- 8 files changed, 40 deletions(-) diff --git a/pkg/agent/deb/rules b/pkg/agent/deb/rules index 83b27373..4d96edac 100644 --- a/pkg/agent/deb/rules +++ b/pkg/agent/deb/rules @@ -1,10 +1,5 @@ #!/usr/bin/make -f -# force packages to be built with xz compression, as Ubuntu 21.10 and up use -# zstd compression, which is non-standard, and breaks 'dpkg-sig --verify' -override_dh_builddeb: - dh_builddeb -- -Zxz - override_dh_auto_build: set -x; \ install -d /usr/libexec/docker/cli-plugins && \ diff --git a/pkg/buildx/deb/rules b/pkg/buildx/deb/rules index 5573b276..e6974ad2 100644 --- a/pkg/buildx/deb/rules +++ b/pkg/buildx/deb/rules @@ -1,10 +1,5 @@ #!/usr/bin/make -f -# force packages to be built with xz compression, as Ubuntu 21.10 and up use -# zstd compression, which is non-standard, and breaks 'dpkg-sig --verify' -override_dh_builddeb: - dh_builddeb -- -Zxz - override_dh_auto_build: cd $(CURDIR)/buildx && \ go build \ diff --git a/pkg/compose/deb/rules b/pkg/compose/deb/rules index ece373bf..600d6058 100644 --- a/pkg/compose/deb/rules +++ b/pkg/compose/deb/rules @@ -1,10 +1,5 @@ #!/usr/bin/make -f -# force packages to be built with xz compression, as Ubuntu 21.10 and up use -# zstd compression, which is non-standard, and breaks 'dpkg-sig --verify' -override_dh_builddeb: - dh_builddeb -- -Zxz - override_dh_auto_build: cd $(CURDIR)/compose && \ make VERSION=$(VERSION) DESTDIR=/usr/libexec/docker/cli-plugins build diff --git a/pkg/containerd/deb/rules b/pkg/containerd/deb/rules index afbc1bbb..3dfaae35 100755 --- a/pkg/containerd/deb/rules +++ b/pkg/containerd/deb/rules @@ -48,11 +48,6 @@ man: ## Create containerd man pages install -d man install -D -p -m 0644 /go/src/github.com/containerd/containerd/man/* man -# force packages to be built with xz compression, as Ubuntu 21.10 and up use -# zstd compression, which is non-standard, and breaks 'dpkg-sig --verify' -override_dh_builddeb: - dh_builddeb -- -Zxz - # http://manpages.debian.org/dh_dwz override_dh_dwz: # dh_dwz in debhelper versions less than 13 has issues with files that are missing debug symbols (once we update to debhelper-compat 13+ this can be removed) diff --git a/pkg/credential-helpers/deb/rules b/pkg/credential-helpers/deb/rules index ff1f1e98..badffed2 100644 --- a/pkg/credential-helpers/deb/rules +++ b/pkg/credential-helpers/deb/rules @@ -1,10 +1,5 @@ #!/usr/bin/make -f -# force packages to be built with xz compression, as Ubuntu 21.10 and up use -# zstd compression, which is non-standard, and breaks 'dpkg-sig --verify' -override_dh_builddeb: - dh_builddeb -- -Zxz - override_dh_auto_build: CGO_ENABLED=1 make -C ./docker-credential-helpers build-secretservice build-pass VERSION=$(VERSION) REVISION=$(REVISION) DESTDIR=$$(pwd)/bin diff --git a/pkg/docker-cli/deb/rules b/pkg/docker-cli/deb/rules index d6c29826..60f7faff 100644 --- a/pkg/docker-cli/deb/rules +++ b/pkg/docker-cli/deb/rules @@ -1,10 +1,5 @@ #!/usr/bin/make -f -# force packages to be built with xz compression, as Ubuntu 21.10 and up use -# zstd compression, which is non-standard, and breaks 'dpkg-sig --verify' -override_dh_builddeb: - dh_builddeb -- -Zxz - override_dh_auto_build: mkdir -p /go/src/github.com/docker && \ ln -snf $(CURDIR)/cli /go/src/github.com/docker/cli && \ diff --git a/pkg/docker-engine/deb/rules b/pkg/docker-engine/deb/rules index a2862127..b5083954 100755 --- a/pkg/docker-engine/deb/rules +++ b/pkg/docker-engine/deb/rules @@ -1,10 +1,5 @@ #!/usr/bin/make -f -# force packages to be built with xz compression, as Ubuntu 21.10 and up use -# zstd compression, which is non-standard, and breaks 'dpkg-sig --verify' -override_dh_builddeb: - dh_builddeb -- -Zxz - override_dh_auto_build: mkdir -p /go/src/github.com/docker ln -snf $(CURDIR)/engine /go/src/github.com/docker/docker diff --git a/pkg/model/deb/rules b/pkg/model/deb/rules index 53bfc4e0..00229e13 100644 --- a/pkg/model/deb/rules +++ b/pkg/model/deb/rules @@ -1,10 +1,5 @@ #!/usr/bin/make -f -# force packages to be built with xz compression, as Ubuntu 21.10 and up use -# zstd compression, which is non-standard, and breaks 'dpkg-sig --verify' -override_dh_builddeb: - dh_builddeb -- -Zxz - override_dh_auto_build: mkdir -p /usr/libexec/docker/cli-plugins && \ GO111MODULE=on make -C $(CURDIR)/model/cmd/cli VERSION=$(VERSION) ce-release \