From fcd7cfc87be95e6f50c5fbca3b106c045039662f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Wed, 7 Oct 2026 21:14:17 +0200 Subject: [PATCH 1/2] Use short Git commit in docker CLI and engine version output MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `docker version` showed the full 40-character commit for binaries built here. Packages from docker-ce-packaging, and the engine deb and rpm packages here, show the 7-character short hash. Signed-off-by: Paweł Gronowski --- pkg/docker-cli/scripts/pkg-deb-build.sh | 2 +- pkg/docker-cli/scripts/pkg-rpm-build.sh | 2 +- pkg/docker-cli/scripts/pkg-static-build.sh | 2 +- pkg/docker-engine/scripts/pkg-static-build.sh | 2 +- pkg/docker/scripts/pkg-static-build.sh | 4 ++-- pkg/docker/scripts/pkg-static-darwin-build.sh | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/pkg/docker-cli/scripts/pkg-deb-build.sh b/pkg/docker-cli/scripts/pkg-deb-build.sh index ef643954..23eaaca1 100755 --- a/pkg/docker-cli/scripts/pkg-deb-build.sh +++ b/pkg/docker-cli/scripts/pkg-deb-build.sh @@ -70,5 +70,5 @@ mkdir -p "${pkgoutput}" set -x chmod -x debian/control debian/docs debian/*.manpages -VERSION=${GENVER_VERSION#v} REVISION=${GENVER_COMMIT} dpkg-buildpackage $PKG_DEB_BUILDFLAGS --host-arch $(xx-info debian-arch) --target-arch $(xx-info debian-arch) +VERSION=${GENVER_VERSION#v} REVISION=${GENVER_COMMIT_SHORT} dpkg-buildpackage $PKG_DEB_BUILDFLAGS --host-arch $(xx-info debian-arch) --target-arch $(xx-info debian-arch) cp /root/docker-* "${pkgoutput}"/ diff --git a/pkg/docker-cli/scripts/pkg-rpm-build.sh b/pkg/docker-cli/scripts/pkg-rpm-build.sh index 8f7b6a38..7062e8a1 100755 --- a/pkg/docker-cli/scripts/pkg-rpm-build.sh +++ b/pkg/docker-cli/scripts/pkg-rpm-build.sh @@ -62,7 +62,7 @@ rpmDefine=( --define "_version ${GENVER_PKG_VERSION}" --define "_origversion ${GENVER_VERSION#v}" --define "_release ${PKG_RPM_RELEASE:-${GENVER_RPM_RELEASE}}" - --define "_commit ${GENVER_COMMIT}" + --define "_commit ${GENVER_COMMIT_SHORT}" ) pkgoutput="${OUTDIR}/${DISTRO_RELEASE}/${DISTRO_SUITE}/$(xx-info arch)" diff --git a/pkg/docker-cli/scripts/pkg-static-build.sh b/pkg/docker-cli/scripts/pkg-static-build.sh index 0862402e..f1d06a34 100755 --- a/pkg/docker-cli/scripts/pkg-static-build.sh +++ b/pkg/docker-cli/scripts/pkg-static-build.sh @@ -63,7 +63,7 @@ clibin="docker${binext}" ( set -x pushd ${SRCDIR} - VERSION=${GENVER_VERSION} GITCOMMIT=${GENVER_COMMIT} GO_LINKMODE=static TARGET=${BUILDDIR}/${PKG_NAME} ./scripts/build/binary + VERSION=${GENVER_VERSION} GITCOMMIT=${GENVER_COMMIT_SHORT} GO_LINKMODE=static TARGET=${BUILDDIR}/${PKG_NAME} ./scripts/build/binary popd xx-verify --static "${BUILDDIR}/${PKG_NAME}/docker" ) diff --git a/pkg/docker-engine/scripts/pkg-static-build.sh b/pkg/docker-engine/scripts/pkg-static-build.sh index eb8f9a11..776d2a29 100755 --- a/pkg/docker-engine/scripts/pkg-static-build.sh +++ b/pkg/docker-engine/scripts/pkg-static-build.sh @@ -59,7 +59,7 @@ mkdir -p ${BUILDDIR}/${PKG_NAME} ( set -x pushd ${SRCDIR} - CGO_ENABLED=1 VERSION=${GENVER_VERSION} DOCKER_GITCOMMIT=${GENVER_COMMIT} ./hack/make.sh binary + CGO_ENABLED=1 VERSION=${GENVER_VERSION} DOCKER_GITCOMMIT=${GENVER_COMMIT_SHORT} ./hack/make.sh binary mv "./bundles/binary-daemon/dockerd${binext}" "${BUILDDIR}/${PKG_NAME}/" if [ "$(xx-info os)" != "windows" ]; then mv "./bundles/binary-daemon/docker-proxy${binext}" "${BUILDDIR}/${PKG_NAME}/" diff --git a/pkg/docker/scripts/pkg-static-build.sh b/pkg/docker/scripts/pkg-static-build.sh index 79cc4684..43a864ce 100755 --- a/pkg/docker/scripts/pkg-static-build.sh +++ b/pkg/docker/scripts/pkg-static-build.sh @@ -101,7 +101,7 @@ fetch_git_ref() { ( set -x pushd "${ENGINE_SRCDIR}" - CGO_ENABLED=1 VERSION="${version}" DOCKER_GITCOMMIT="${ENGINE_GENVER_COMMIT}" ./hack/make.sh binary + CGO_ENABLED=1 VERSION="${version}" DOCKER_GITCOMMIT="${ENGINE_GENVER_COMMIT_SHORT}" ./hack/make.sh binary mv "./bundles/binary-daemon/dockerd${binext}" "${engine_builddir}/" if [ "$(xx-info os)" != "windows" ]; then mv "./bundles/binary-daemon/docker-proxy${binext}" "${engine_builddir}/" @@ -128,7 +128,7 @@ fi ( set -x pushd "${CLI_SRCDIR}" - CGO_ENABLED=0 GO111MODULE=off VERSION="${version}" GITCOMMIT="${CLI_GENVER_COMMIT}" GO_LINKMODE=static TARGET="${cli_builddir}" ./scripts/build/binary + CGO_ENABLED=0 GO111MODULE=off VERSION="${version}" GITCOMMIT="${CLI_GENVER_COMMIT_SHORT}" GO_LINKMODE=static TARGET="${cli_builddir}" ./scripts/build/binary popd xx-verify --static "${cli_builddir}/docker" ) diff --git a/pkg/docker/scripts/pkg-static-darwin-build.sh b/pkg/docker/scripts/pkg-static-darwin-build.sh index f2101a9b..f017e938 100755 --- a/pkg/docker/scripts/pkg-static-darwin-build.sh +++ b/pkg/docker/scripts/pkg-static-darwin-build.sh @@ -53,7 +53,7 @@ mkdir -p "$cli_builddir" ( set -x cd "${CLI_SRCDIR}" - CGO_ENABLED=0 GO111MODULE=off VERSION="${VERSION#v}" GITCOMMIT="${CLI_COMMIT}" GO_LINKMODE=static TARGET="${cli_builddir}" ./scripts/build/binary + CGO_ENABLED=0 GO111MODULE=off VERSION="${VERSION#v}" GITCOMMIT="${CLI_COMMIT:0:7}" GO_LINKMODE=static TARGET="${cli_builddir}" ./scripts/build/binary ) xx-verify --static "${cli_builddir}/docker" From 0c3defb300afeddff5558b62b9890a9978bd7bea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Gronowski?= Date: Wed, 7 Oct 2026 21:28:35 +0200 Subject: [PATCH 2/2] pkg: Drop the v prefix from static CLI and Engine versions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Static docker-cli and docker-engine archives still reported versions like v29.9.0-rc.2 in `docker version`. The earlier change that dropped the prefix covered the deb, rpm, and combined docker builds, but missed these two static build scripts. Strip the prefix from GENVER_VERSION before passing it to the CLI and Engine builds, as the other builds already do. Signed-off-by: Paweł Gronowski --- pkg/docker-cli/scripts/pkg-static-build.sh | 2 +- pkg/docker-engine/scripts/pkg-static-build.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/docker-cli/scripts/pkg-static-build.sh b/pkg/docker-cli/scripts/pkg-static-build.sh index f1d06a34..4f6bb5df 100755 --- a/pkg/docker-cli/scripts/pkg-static-build.sh +++ b/pkg/docker-cli/scripts/pkg-static-build.sh @@ -63,7 +63,7 @@ clibin="docker${binext}" ( set -x pushd ${SRCDIR} - VERSION=${GENVER_VERSION} GITCOMMIT=${GENVER_COMMIT_SHORT} GO_LINKMODE=static TARGET=${BUILDDIR}/${PKG_NAME} ./scripts/build/binary + VERSION=${GENVER_VERSION#v} GITCOMMIT=${GENVER_COMMIT_SHORT} GO_LINKMODE=static TARGET=${BUILDDIR}/${PKG_NAME} ./scripts/build/binary popd xx-verify --static "${BUILDDIR}/${PKG_NAME}/docker" ) diff --git a/pkg/docker-engine/scripts/pkg-static-build.sh b/pkg/docker-engine/scripts/pkg-static-build.sh index 776d2a29..baf0f9cf 100755 --- a/pkg/docker-engine/scripts/pkg-static-build.sh +++ b/pkg/docker-engine/scripts/pkg-static-build.sh @@ -59,7 +59,7 @@ mkdir -p ${BUILDDIR}/${PKG_NAME} ( set -x pushd ${SRCDIR} - CGO_ENABLED=1 VERSION=${GENVER_VERSION} DOCKER_GITCOMMIT=${GENVER_COMMIT_SHORT} ./hack/make.sh binary + CGO_ENABLED=1 VERSION=${GENVER_VERSION#v} DOCKER_GITCOMMIT=${GENVER_COMMIT_SHORT} ./hack/make.sh binary mv "./bundles/binary-daemon/dockerd${binext}" "${BUILDDIR}/${PKG_NAME}/" if [ "$(xx-info os)" != "windows" ]; then mv "./bundles/binary-daemon/docker-proxy${binext}" "${BUILDDIR}/${PKG_NAME}/"