From 445ecd831b88602ad7711130d02c8e5029fb3d04 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 9 Nov 2026 19:10:21 +0100 Subject: [PATCH 1/8] 29-rc: add checksum verification Signed-off-by: Sebastiaan van Stijn --- 29-rc/cli/Dockerfile | 7 ++++ 29-rc/dind-rootless/Dockerfile | 3 ++ 29-rc/dind/Dockerfile | 7 ++++ .../windowsservercore-ltsc2022/Dockerfile | 10 ++++-- .../windowsservercore-ltsc2025/Dockerfile | 10 ++++-- Dockerfile-cli.template | 2 +- Dockerfile-dind-rootless.template | 2 +- Dockerfile-dind.template | 2 +- Dockerfile-windows-servercore.template | 10 ++++-- versions.json | 9 +++++ versions.sh | 35 ++++++++++++++++--- 11 files changed, 81 insertions(+), 16 deletions(-) diff --git a/29-rc/cli/Dockerfile b/29-rc/cli/Dockerfile index 679296f51..4250919fb 100644 --- a/29-rc/cli/Dockerfile +++ b/29-rc/cli/Dockerfile @@ -31,26 +31,33 @@ RUN set -eux; \ case "$apkArch" in \ 'x86_64') \ url='https://download.docker.com/linux/static/test/x86_64/docker-29.10.0-rc.1.tgz'; \ + sha256='d023bcab935f045548c5df79ea96d1f3fccbc091cf9a8347139154859f4767b8'; \ ;; \ 'armhf') \ url='https://download.docker.com/linux/static/test/armel/docker-29.10.0-rc.1.tgz'; \ + sha256='55aedd3f6b42d8dd3e397358f0ca4fb321cb89cce325b9a239842866ecee3f8f'; \ ;; \ 'armv7') \ url='https://download.docker.com/linux/static/test/armhf/docker-29.10.0-rc.1.tgz'; \ + sha256='d244956ea5ba6b9ca88acd24b6cc67ee5bd56c39f1d870a8d317ec472b0cc223'; \ ;; \ 'aarch64') \ url='https://download.docker.com/linux/static/test/aarch64/docker-29.10.0-rc.1.tgz'; \ + sha256='48348b68501015c3d9cc2c2a0344588eb0676cf68c38dd4ffd881a75e2d8662c'; \ ;; \ 'ppc64le') \ url='https://download.docker.com/linux/static/test/ppc64le/docker-29.10.0-rc.1.tgz'; \ + sha256='1db34bee3e77a4af021631a5492b9385c3aafedd1b2aa3f693a60ca6760a3315'; \ ;; \ 's390x') \ url='https://download.docker.com/linux/static/test/s390x/docker-29.10.0-rc.1.tgz'; \ + sha256='78546fc2dcf04c7844e3e3f54b05485da64c852fceee453f2c8bac7b4ecd896b'; \ ;; \ *) echo >&2 "error: unsupported 'docker.tgz' architecture ($apkArch)"; exit 1 ;; \ esac; \ \ wget -O 'docker.tgz' "$url"; \ + echo "$sha256 *"'docker.tgz' | sha256sum -c -; \ \ tar --extract \ --file docker.tgz \ diff --git a/29-rc/dind-rootless/Dockerfile b/29-rc/dind-rootless/Dockerfile index 0b588e617..9696086e7 100644 --- a/29-rc/dind-rootless/Dockerfile +++ b/29-rc/dind-rootless/Dockerfile @@ -27,14 +27,17 @@ RUN set -eux; \ case "$apkArch" in \ 'x86_64') \ url='https://download.docker.com/linux/static/test/x86_64/docker-rootless-extras-29.10.0-rc.1.tgz'; \ + sha256='e63ea3c6e4a28575be61bae88303b335c9637198d79a1b1aaae17ad0f955abc9'; \ ;; \ 'aarch64') \ url='https://download.docker.com/linux/static/test/aarch64/docker-rootless-extras-29.10.0-rc.1.tgz'; \ + sha256='2db6e2f180b66a4b5f6555f56041c85e55537230aaf939fdf18d60e1cea59c9e'; \ ;; \ *) echo >&2 "error: unsupported 'rootless.tgz' architecture ($apkArch)"; exit 1 ;; \ esac; \ \ wget -O 'rootless.tgz' "$url"; \ + echo "$sha256 *"'rootless.tgz' | sha256sum -c -; \ \ tar --extract \ --file rootless.tgz \ diff --git a/29-rc/dind/Dockerfile b/29-rc/dind/Dockerfile index 9f5bcfb64..a9331210f 100644 --- a/29-rc/dind/Dockerfile +++ b/29-rc/dind/Dockerfile @@ -57,26 +57,33 @@ RUN set -eux; \ case "$apkArch" in \ 'x86_64') \ url='https://download.docker.com/linux/static/test/x86_64/docker-29.10.0-rc.1.tgz'; \ + sha256='d023bcab935f045548c5df79ea96d1f3fccbc091cf9a8347139154859f4767b8'; \ ;; \ 'armhf') \ url='https://download.docker.com/linux/static/test/armel/docker-29.10.0-rc.1.tgz'; \ + sha256='55aedd3f6b42d8dd3e397358f0ca4fb321cb89cce325b9a239842866ecee3f8f'; \ ;; \ 'armv7') \ url='https://download.docker.com/linux/static/test/armhf/docker-29.10.0-rc.1.tgz'; \ + sha256='d244956ea5ba6b9ca88acd24b6cc67ee5bd56c39f1d870a8d317ec472b0cc223'; \ ;; \ 'aarch64') \ url='https://download.docker.com/linux/static/test/aarch64/docker-29.10.0-rc.1.tgz'; \ + sha256='48348b68501015c3d9cc2c2a0344588eb0676cf68c38dd4ffd881a75e2d8662c'; \ ;; \ 'ppc64le') \ url='https://download.docker.com/linux/static/test/ppc64le/docker-29.10.0-rc.1.tgz'; \ + sha256='1db34bee3e77a4af021631a5492b9385c3aafedd1b2aa3f693a60ca6760a3315'; \ ;; \ 's390x') \ url='https://download.docker.com/linux/static/test/s390x/docker-29.10.0-rc.1.tgz'; \ + sha256='78546fc2dcf04c7844e3e3f54b05485da64c852fceee453f2c8bac7b4ecd896b'; \ ;; \ *) echo >&2 "error: unsupported 'docker.tgz' architecture ($apkArch)"; exit 1 ;; \ esac; \ \ wget -O 'docker.tgz' "$url"; \ + echo "$sha256 *"'docker.tgz' | sha256sum -c -; \ \ tar --extract \ --file docker.tgz \ diff --git a/29-rc/windows/windowsservercore-ltsc2022/Dockerfile b/29-rc/windows/windowsservercore-ltsc2022/Dockerfile index 1ec5d07eb..0f6a7f5fd 100644 --- a/29-rc/windows/windowsservercore-ltsc2022/Dockerfile +++ b/29-rc/windows/windowsservercore-ltsc2022/Dockerfile @@ -17,13 +17,17 @@ RUN $newPath = ('{0}\docker;{1}' -f $env:ProgramFiles, $env:PATH); \ ENV DOCKER_VERSION 29.10.0-rc.1 ENV DOCKER_URL https://download.docker.com/win/static/test/x86_64/docker-29.10.0-rc.1.zip -# TODO ENV DOCKER_SHA256 -# https://github.com/docker/docker-ce/blob/5b073ee2cf564edee5adca05eee574142f7627bb/components/packaging/static/hash_files !! -# (no SHA file artifacts on download.docker.com yet as of 2017-06-07 though) +ENV DOCKER_SHA256 d3f21d8d1487ee8a0bc936cb65c5149b1f5bebe2d05499c6bcfdcd8b81030c7b RUN Write-Host ('Downloading {0} ...' -f $env:DOCKER_URL); \ Invoke-WebRequest -Uri $env:DOCKER_URL -OutFile 'docker.zip'; \ \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ + if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ Write-Host 'Expanding ...'; \ Expand-Archive docker.zip -DestinationPath $env:ProgramFiles; \ # (this archive has a "docker/..." directory in it already) diff --git a/29-rc/windows/windowsservercore-ltsc2025/Dockerfile b/29-rc/windows/windowsservercore-ltsc2025/Dockerfile index 77da2b170..1518e5861 100644 --- a/29-rc/windows/windowsservercore-ltsc2025/Dockerfile +++ b/29-rc/windows/windowsservercore-ltsc2025/Dockerfile @@ -17,13 +17,17 @@ RUN $newPath = ('{0}\docker;{1}' -f $env:ProgramFiles, $env:PATH); \ ENV DOCKER_VERSION 29.10.0-rc.1 ENV DOCKER_URL https://download.docker.com/win/static/test/x86_64/docker-29.10.0-rc.1.zip -# TODO ENV DOCKER_SHA256 -# https://github.com/docker/docker-ce/blob/5b073ee2cf564edee5adca05eee574142f7627bb/components/packaging/static/hash_files !! -# (no SHA file artifacts on download.docker.com yet as of 2017-06-07 though) +ENV DOCKER_SHA256 d3f21d8d1487ee8a0bc936cb65c5149b1f5bebe2d05499c6bcfdcd8b81030c7b RUN Write-Host ('Downloading {0} ...' -f $env:DOCKER_URL); \ Invoke-WebRequest -Uri $env:DOCKER_URL -OutFile 'docker.zip'; \ \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ + if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ Write-Host 'Expanding ...'; \ Expand-Archive docker.zip -DestinationPath $env:ProgramFiles; \ # (this archive has a "docker/..." directory in it already) diff --git a/Dockerfile-cli.template b/Dockerfile-cli.template index 101e75358..273ddf5af 100644 --- a/Dockerfile-cli.template +++ b/Dockerfile-cli.template @@ -26,7 +26,7 @@ RUN set -eux; \ download({ arches: .arches, urlKey: "dockerUrl", - # TODO sha256Key (once Docker publishes them 😭) + sha256Key: "dockerSha256", target: "docker.tgz", }) }}; \ diff --git a/Dockerfile-dind-rootless.template b/Dockerfile-dind-rootless.template index 884fb56b0..85ba8c6f0 100644 --- a/Dockerfile-dind-rootless.template +++ b/Dockerfile-dind-rootless.template @@ -22,7 +22,7 @@ RUN set -eux; \ download({ arches: .arches, urlKey: "rootlessExtrasUrl", - # TODO sha256Key (once Docker publishes them 😭) + sha256Key: "rootlessExtrasSha256", target: "rootless.tgz", }) }}; \ diff --git a/Dockerfile-dind.template b/Dockerfile-dind.template index 446c03414..3c9459358 100644 --- a/Dockerfile-dind.template +++ b/Dockerfile-dind.template @@ -52,7 +52,7 @@ RUN set -eux; \ download({ arches: .arches, urlKey: "dockerUrl", - # TODO sha256Key (once Docker publishes them 😭) + sha256Key: "dockerSha256", target: "docker.tgz", }) }}; \ diff --git a/Dockerfile-windows-servercore.template b/Dockerfile-windows-servercore.template index b607c222b..030a69b22 100644 --- a/Dockerfile-windows-servercore.template +++ b/Dockerfile-windows-servercore.template @@ -11,13 +11,17 @@ RUN $newPath = ('{0}\docker;{1}' -f $env:ProgramFiles, $env:PATH); \ ENV DOCKER_VERSION {{ .version }} ENV DOCKER_URL {{ .arches["windows-amd64"].dockerUrl }} -# TODO ENV DOCKER_SHA256 -# https://github.com/docker/docker-ce/blob/5b073ee2cf564edee5adca05eee574142f7627bb/components/packaging/static/hash_files !! -# (no SHA file artifacts on download.docker.com yet as of 2017-06-07 though) +ENV DOCKER_SHA256 {{ .arches["windows-amd64"].dockerSha256 }} RUN Write-Host ('Downloading {0} ...' -f $env:DOCKER_URL); \ Invoke-WebRequest -Uri $env:DOCKER_URL -OutFile 'docker.zip'; \ \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ + if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + \ Write-Host 'Expanding ...'; \ Expand-Archive docker.zip -DestinationPath $env:ProgramFiles; \ # (this archive has a "docker/..." directory in it already) diff --git a/versions.json b/versions.json index 01c7980d4..c475497ac 100644 --- a/versions.json +++ b/versions.json @@ -182,26 +182,35 @@ "29-rc": { "arches": { "amd64": { + "dockerSha256": "d023bcab935f045548c5df79ea96d1f3fccbc091cf9a8347139154859f4767b8", "dockerUrl": "https://download.docker.com/linux/static/test/x86_64/docker-29.10.0-rc.1.tgz", + "rootlessExtrasSha256": "e63ea3c6e4a28575be61bae88303b335c9637198d79a1b1aaae17ad0f955abc9", "rootlessExtrasUrl": "https://download.docker.com/linux/static/test/x86_64/docker-rootless-extras-29.10.0-rc.1.tgz" }, "arm32v6": { + "dockerSha256": "55aedd3f6b42d8dd3e397358f0ca4fb321cb89cce325b9a239842866ecee3f8f", "dockerUrl": "https://download.docker.com/linux/static/test/armel/docker-29.10.0-rc.1.tgz" }, "arm32v7": { + "dockerSha256": "d244956ea5ba6b9ca88acd24b6cc67ee5bd56c39f1d870a8d317ec472b0cc223", "dockerUrl": "https://download.docker.com/linux/static/test/armhf/docker-29.10.0-rc.1.tgz" }, "arm64v8": { + "dockerSha256": "48348b68501015c3d9cc2c2a0344588eb0676cf68c38dd4ffd881a75e2d8662c", "dockerUrl": "https://download.docker.com/linux/static/test/aarch64/docker-29.10.0-rc.1.tgz", + "rootlessExtrasSha256": "2db6e2f180b66a4b5f6555f56041c85e55537230aaf939fdf18d60e1cea59c9e", "rootlessExtrasUrl": "https://download.docker.com/linux/static/test/aarch64/docker-rootless-extras-29.10.0-rc.1.tgz" }, "ppc64le": { + "dockerSha256": "1db34bee3e77a4af021631a5492b9385c3aafedd1b2aa3f693a60ca6760a3315", "dockerUrl": "https://download.docker.com/linux/static/test/ppc64le/docker-29.10.0-rc.1.tgz" }, "s390x": { + "dockerSha256": "78546fc2dcf04c7844e3e3f54b05485da64c852fceee453f2c8bac7b4ecd896b", "dockerUrl": "https://download.docker.com/linux/static/test/s390x/docker-29.10.0-rc.1.tgz" }, "windows-amd64": { + "dockerSha256": "d3f21d8d1487ee8a0bc936cb65c5149b1f5bebe2d05499c6bcfdcd8b81030c7b", "dockerUrl": "https://download.docker.com/win/static/test/x86_64/docker-29.10.0-rc.1.zip" } }, diff --git a/versions.sh b/versions.sh index e67957bb8..ece501672 100755 --- a/versions.sh +++ b/versions.sh @@ -228,7 +228,18 @@ for version in "${versions[@]}"; do else continue fi + if checksum="$(_curl "$url.sha256")"; then + read -r sha256 filename <<< "$checksum" + if [[ ! "$sha256" =~ ^[[:xdigit:]]{64}$ ]] || [[ "$filename" != "${url##*/}" ]]; then + echo >&2 "error: invalid checksum for $url" + exit 1 + fi + export sha256 + doc="$(jq <<<"$doc" -c ' + .arches[env.bashbrewArch].dockerSha256 = env.sha256 + ')" + fi hasArches["$bashbrewArch"]=1 if [ -n "$windows" ]; then @@ -241,10 +252,26 @@ for version in "${versions[@]}"; do amd64 | arm64v8) rootlessExtrasUrl="https://download.docker.com/linux/static/$channel/$arch/docker-rootless-extras-$fullVersion.tgz" if _curl --head "$rootlessExtrasUrl" > /dev/null; then - export rootlessExtrasUrl - doc="$(jq <<<"$doc" -c ' - .arches[env.bashbrewArch].rootlessExtrasUrl = env.rootlessExtrasUrl - ')" + if rootlessExtrasChecksum="$(_curl "$rootlessExtrasUrl.sha256")"; then + read -r rootlessExtrasSha256 filename <<< "$rootlessExtrasChecksum" + if [[ ! "$rootlessExtrasSha256" =~ ^[[:xdigit:]]{64}$ ]] || [[ "$filename" != "${rootlessExtrasUrl##*/}" ]]; then + echo >&2 "error: invalid checksum for $rootlessExtrasUrl" + exit 1 + fi + + export rootlessExtrasUrl rootlessExtrasSha256 + doc="$(jq <<<"$doc" -c ' + .arches[env.bashbrewArch] += { + rootlessExtrasUrl: env.rootlessExtrasUrl, + rootlessExtrasSha256: env.rootlessExtrasSha256, + } + ')" + else + export rootlessExtrasUrl + doc="$(jq <<<"$doc" -c ' + .arches[env.bashbrewArch].rootlessExtrasUrl = env.rootlessExtrasUrl + ')" + fi fi ;; esac From 79dd89c7ce958986e402d594fff6dae82ecc4b20 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 9 Nov 2026 19:36:50 +0100 Subject: [PATCH 2/8] fixup! 29-rc: add checksum verification Signed-off-by: Sebastiaan van Stijn --- Dockerfile-windows-servercore.template | 12 +++++++----- shared.jq | 8 +++++--- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/Dockerfile-windows-servercore.template b/Dockerfile-windows-servercore.template index 030a69b22..3c84e20b2 100644 --- a/Dockerfile-windows-servercore.template +++ b/Dockerfile-windows-servercore.template @@ -11,15 +11,17 @@ RUN $newPath = ('{0}\docker;{1}' -f $env:ProgramFiles, $env:PATH); \ ENV DOCKER_VERSION {{ .version }} ENV DOCKER_URL {{ .arches["windows-amd64"].dockerUrl }} -ENV DOCKER_SHA256 {{ .arches["windows-amd64"].dockerSha256 }} +ENV DOCKER_SHA256 "{{ .arches["windows-amd64"].dockerSha256 }}" RUN Write-Host ('Downloading {0} ...' -f $env:DOCKER_URL); \ Invoke-WebRequest -Uri $env:DOCKER_URL -OutFile 'docker.zip'; \ \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ - if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ + if ($env:DOCKER_SHA256) { \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ + if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ }; \ \ Write-Host 'Expanding ...'; \ diff --git a/shared.jq b/shared.jq index c3213117e..372d77d20 100644 --- a/shared.jq +++ b/shared.jq @@ -40,11 +40,11 @@ def download(opts): | .value | .[opts.urlKey] as $url | (if $notSha256 then "none" else .[opts.sha256Key] end) as $sha256 - | select($apkArch and $url and $sha256) + | select($apkArch and $url) | (" \($apkArch | @sh)) url=\($url | @sh);" - + if $notSha256 then "" else " + + if $notSha256 or ($sha256 == null) then "" else " sha256=\($sha256 | @sh);" end + " ;;" @@ -58,7 +58,9 @@ def download(opts): wget -O \(opts.target | @sh) \"$url\";" , if $notSha256 then "" else " - echo \"$sha256 *\"\(opts.target | @sh) | sha256sum -c -;" + if [ -n \"${sha256:-}\" ]; then + echo \"$sha256 *\"\(opts.target | @sh) | sha256sum -c -; + fi;" end ] | add | rtrimstr(";") From ed5ff0d4ee4b4014cb6bb7272554b7a6f5214403 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Mon, 9 Nov 2026 19:48:27 +0100 Subject: [PATCH 3/8] regenerate dockerfiles Signed-off-by: Sebastiaan van Stijn --- 29-rc/cli/Dockerfile | 12 +++++++++--- 29-rc/dind-rootless/Dockerfile | 4 +++- 29-rc/dind/Dockerfile | 4 +++- 29-rc/windows/windowsservercore-ltsc2022/Dockerfile | 12 +++++++----- 29-rc/windows/windowsservercore-ltsc2025/Dockerfile | 12 +++++++----- 29/cli/Dockerfile | 11 +++++++++-- 29/dind-rootless/Dockerfile | 3 +++ 29/dind/Dockerfile | 3 +++ 29/windows/windowsservercore-ltsc2022/Dockerfile | 12 +++++++++--- 29/windows/windowsservercore-ltsc2025/Dockerfile | 12 +++++++++--- 10 files changed, 62 insertions(+), 23 deletions(-) diff --git a/29-rc/cli/Dockerfile b/29-rc/cli/Dockerfile index 4250919fb..dde164fbb 100644 --- a/29-rc/cli/Dockerfile +++ b/29-rc/cli/Dockerfile @@ -57,7 +57,9 @@ RUN set -eux; \ esac; \ \ wget -O 'docker.tgz' "$url"; \ - echo "$sha256 *"'docker.tgz' | sha256sum -c -; \ + if [ -n "${sha256:-}" ]; then \ + echo "$sha256 *"'docker.tgz' | sha256sum -c -; \ + fi; \ \ tar --extract \ --file docker.tgz \ @@ -107,7 +109,9 @@ RUN set -eux; \ esac; \ \ wget -O 'docker-buildx' "$url"; \ - echo "$sha256 *"'docker-buildx' | sha256sum -c -; \ + if [ -n "${sha256:-}" ]; then \ + echo "$sha256 *"'docker-buildx' | sha256sum -c -; \ + fi; \ \ plugin='/usr/local/libexec/docker/cli-plugins/docker-buildx'; \ mkdir -p "$(dirname "$plugin")"; \ @@ -153,7 +157,9 @@ RUN set -eux; \ esac; \ \ wget -O 'docker-compose' "$url"; \ - echo "$sha256 *"'docker-compose' | sha256sum -c -; \ + if [ -n "${sha256:-}" ]; then \ + echo "$sha256 *"'docker-compose' | sha256sum -c -; \ + fi; \ \ plugin='/usr/local/libexec/docker/cli-plugins/docker-compose'; \ mkdir -p "$(dirname "$plugin")"; \ diff --git a/29-rc/dind-rootless/Dockerfile b/29-rc/dind-rootless/Dockerfile index 9696086e7..05ae04784 100644 --- a/29-rc/dind-rootless/Dockerfile +++ b/29-rc/dind-rootless/Dockerfile @@ -37,7 +37,9 @@ RUN set -eux; \ esac; \ \ wget -O 'rootless.tgz' "$url"; \ - echo "$sha256 *"'rootless.tgz' | sha256sum -c -; \ + if [ -n "${sha256:-}" ]; then \ + echo "$sha256 *"'rootless.tgz' | sha256sum -c -; \ + fi; \ \ tar --extract \ --file rootless.tgz \ diff --git a/29-rc/dind/Dockerfile b/29-rc/dind/Dockerfile index a9331210f..fe309088e 100644 --- a/29-rc/dind/Dockerfile +++ b/29-rc/dind/Dockerfile @@ -83,7 +83,9 @@ RUN set -eux; \ esac; \ \ wget -O 'docker.tgz' "$url"; \ - echo "$sha256 *"'docker.tgz' | sha256sum -c -; \ + if [ -n "${sha256:-}" ]; then \ + echo "$sha256 *"'docker.tgz' | sha256sum -c -; \ + fi; \ \ tar --extract \ --file docker.tgz \ diff --git a/29-rc/windows/windowsservercore-ltsc2022/Dockerfile b/29-rc/windows/windowsservercore-ltsc2022/Dockerfile index 0f6a7f5fd..aa1c8dfbf 100644 --- a/29-rc/windows/windowsservercore-ltsc2022/Dockerfile +++ b/29-rc/windows/windowsservercore-ltsc2022/Dockerfile @@ -17,15 +17,17 @@ RUN $newPath = ('{0}\docker;{1}' -f $env:ProgramFiles, $env:PATH); \ ENV DOCKER_VERSION 29.10.0-rc.1 ENV DOCKER_URL https://download.docker.com/win/static/test/x86_64/docker-29.10.0-rc.1.zip -ENV DOCKER_SHA256 d3f21d8d1487ee8a0bc936cb65c5149b1f5bebe2d05499c6bcfdcd8b81030c7b +ENV DOCKER_SHA256 "d3f21d8d1487ee8a0bc936cb65c5149b1f5bebe2d05499c6bcfdcd8b81030c7b" RUN Write-Host ('Downloading {0} ...' -f $env:DOCKER_URL); \ Invoke-WebRequest -Uri $env:DOCKER_URL -OutFile 'docker.zip'; \ \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ - if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ + if ($env:DOCKER_SHA256) { \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ + if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ }; \ \ Write-Host 'Expanding ...'; \ diff --git a/29-rc/windows/windowsservercore-ltsc2025/Dockerfile b/29-rc/windows/windowsservercore-ltsc2025/Dockerfile index 1518e5861..bcce05f7e 100644 --- a/29-rc/windows/windowsservercore-ltsc2025/Dockerfile +++ b/29-rc/windows/windowsservercore-ltsc2025/Dockerfile @@ -17,15 +17,17 @@ RUN $newPath = ('{0}\docker;{1}' -f $env:ProgramFiles, $env:PATH); \ ENV DOCKER_VERSION 29.10.0-rc.1 ENV DOCKER_URL https://download.docker.com/win/static/test/x86_64/docker-29.10.0-rc.1.zip -ENV DOCKER_SHA256 d3f21d8d1487ee8a0bc936cb65c5149b1f5bebe2d05499c6bcfdcd8b81030c7b +ENV DOCKER_SHA256 "d3f21d8d1487ee8a0bc936cb65c5149b1f5bebe2d05499c6bcfdcd8b81030c7b" RUN Write-Host ('Downloading {0} ...' -f $env:DOCKER_URL); \ Invoke-WebRequest -Uri $env:DOCKER_URL -OutFile 'docker.zip'; \ \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ - if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ + if ($env:DOCKER_SHA256) { \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ + if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ }; \ \ Write-Host 'Expanding ...'; \ diff --git a/29/cli/Dockerfile b/29/cli/Dockerfile index 9611e898e..771a26fd2 100644 --- a/29/cli/Dockerfile +++ b/29/cli/Dockerfile @@ -45,6 +45,9 @@ RUN set -eux; \ esac; \ \ wget -O 'docker.tgz' "$url"; \ + if [ -n "${sha256:-}" ]; then \ + echo "$sha256 *"'docker.tgz' | sha256sum -c -; \ + fi; \ \ tar --extract \ --file docker.tgz \ @@ -94,7 +97,9 @@ RUN set -eux; \ esac; \ \ wget -O 'docker-buildx' "$url"; \ - echo "$sha256 *"'docker-buildx' | sha256sum -c -; \ + if [ -n "${sha256:-}" ]; then \ + echo "$sha256 *"'docker-buildx' | sha256sum -c -; \ + fi; \ \ plugin='/usr/local/libexec/docker/cli-plugins/docker-buildx'; \ mkdir -p "$(dirname "$plugin")"; \ @@ -140,7 +145,9 @@ RUN set -eux; \ esac; \ \ wget -O 'docker-compose' "$url"; \ - echo "$sha256 *"'docker-compose' | sha256sum -c -; \ + if [ -n "${sha256:-}" ]; then \ + echo "$sha256 *"'docker-compose' | sha256sum -c -; \ + fi; \ \ plugin='/usr/local/libexec/docker/cli-plugins/docker-compose'; \ mkdir -p "$(dirname "$plugin")"; \ diff --git a/29/dind-rootless/Dockerfile b/29/dind-rootless/Dockerfile index 4d110a254..dd5189a7c 100644 --- a/29/dind-rootless/Dockerfile +++ b/29/dind-rootless/Dockerfile @@ -35,6 +35,9 @@ RUN set -eux; \ esac; \ \ wget -O 'rootless.tgz' "$url"; \ + if [ -n "${sha256:-}" ]; then \ + echo "$sha256 *"'rootless.tgz' | sha256sum -c -; \ + fi; \ \ tar --extract \ --file rootless.tgz \ diff --git a/29/dind/Dockerfile b/29/dind/Dockerfile index f23d1ca19..e7f7e2537 100644 --- a/29/dind/Dockerfile +++ b/29/dind/Dockerfile @@ -71,6 +71,9 @@ RUN set -eux; \ esac; \ \ wget -O 'docker.tgz' "$url"; \ + if [ -n "${sha256:-}" ]; then \ + echo "$sha256 *"'docker.tgz' | sha256sum -c -; \ + fi; \ \ tar --extract \ --file docker.tgz \ diff --git a/29/windows/windowsservercore-ltsc2022/Dockerfile b/29/windows/windowsservercore-ltsc2022/Dockerfile index 829713669..30a89f76d 100644 --- a/29/windows/windowsservercore-ltsc2022/Dockerfile +++ b/29/windows/windowsservercore-ltsc2022/Dockerfile @@ -17,13 +17,19 @@ RUN $newPath = ('{0}\docker;{1}' -f $env:ProgramFiles, $env:PATH); \ ENV DOCKER_VERSION 29.9.3 ENV DOCKER_URL https://download.docker.com/win/static/stable/x86_64/docker-29.9.3.zip -# TODO ENV DOCKER_SHA256 -# https://github.com/docker/docker-ce/blob/5b073ee2cf564edee5adca05eee574142f7627bb/components/packaging/static/hash_files !! -# (no SHA file artifacts on download.docker.com yet as of 2017-06-07 though) +ENV DOCKER_SHA256 "" RUN Write-Host ('Downloading {0} ...' -f $env:DOCKER_URL); \ Invoke-WebRequest -Uri $env:DOCKER_URL -OutFile 'docker.zip'; \ \ + if ($env:DOCKER_SHA256) { \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ + if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + }; \ + \ Write-Host 'Expanding ...'; \ Expand-Archive docker.zip -DestinationPath $env:ProgramFiles; \ # (this archive has a "docker/..." directory in it already) diff --git a/29/windows/windowsservercore-ltsc2025/Dockerfile b/29/windows/windowsservercore-ltsc2025/Dockerfile index ef413a931..d2714fc08 100644 --- a/29/windows/windowsservercore-ltsc2025/Dockerfile +++ b/29/windows/windowsservercore-ltsc2025/Dockerfile @@ -17,13 +17,19 @@ RUN $newPath = ('{0}\docker;{1}' -f $env:ProgramFiles, $env:PATH); \ ENV DOCKER_VERSION 29.9.3 ENV DOCKER_URL https://download.docker.com/win/static/stable/x86_64/docker-29.9.3.zip -# TODO ENV DOCKER_SHA256 -# https://github.com/docker/docker-ce/blob/5b073ee2cf564edee5adca05eee574142f7627bb/components/packaging/static/hash_files !! -# (no SHA file artifacts on download.docker.com yet as of 2017-06-07 though) +ENV DOCKER_SHA256 "" RUN Write-Host ('Downloading {0} ...' -f $env:DOCKER_URL); \ Invoke-WebRequest -Uri $env:DOCKER_URL -OutFile 'docker.zip'; \ \ + if ($env:DOCKER_SHA256) { \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ + if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ + }; \ + }; \ + \ Write-Host 'Expanding ...'; \ Expand-Archive docker.zip -DestinationPath $env:ProgramFiles; \ # (this archive has a "docker/..." directory in it already) From fb597021b5c8321e3895e1e84d987dea9969c273 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 10 Nov 2026 11:41:35 +0100 Subject: [PATCH 4/8] review suggestions Co-authored-by: Tianon Gravi Signed-off-by: Sebastiaan van Stijn --- Dockerfile-windows-servercore.template | 21 +++++++++----- shared.jq | 6 ++-- versions.sh | 39 +++++++++++++------------- 3 files changed, 35 insertions(+), 31 deletions(-) diff --git a/Dockerfile-windows-servercore.template b/Dockerfile-windows-servercore.template index 3c84e20b2..d7969968d 100644 --- a/Dockerfile-windows-servercore.template +++ b/Dockerfile-windows-servercore.template @@ -11,19 +11,26 @@ RUN $newPath = ('{0}\docker;{1}' -f $env:ProgramFiles, $env:PATH); \ ENV DOCKER_VERSION {{ .version }} ENV DOCKER_URL {{ .arches["windows-amd64"].dockerUrl }} -ENV DOCKER_SHA256 "{{ .arches["windows-amd64"].dockerSha256 }}" +{{ if .arches["windows-amd64"].dockerSha256 then ( -}} +ENV DOCKER_SHA256 {{ .arches["windows-amd64"].dockerSha256 }} +{{ ) else ( -}} +{{ # TODO remove this whole else block! as of 29.10.0-rc.1, we have checksums 🥳 -}} +# TODO ENV DOCKER_SHA256 +# https://github.com/docker/docker-ce/blob/5b073ee2cf564edee5adca05eee574142f7627bb/components/packaging/static/hash_files !! +# (no SHA file artifacts on download.docker.com yet as of 2017-06-07 though) +{{ ) end -}} RUN Write-Host ('Downloading {0} ...' -f $env:DOCKER_URL); \ Invoke-WebRequest -Uri $env:DOCKER_URL -OutFile 'docker.zip'; \ \ - if ($env:DOCKER_SHA256) { \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ - if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ +{{ if .arches["windows-amd64"].dockerSha256 then ( -}} + Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ + if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ }; \ \ +{{ ) else "" end -}} Write-Host 'Expanding ...'; \ Expand-Archive docker.zip -DestinationPath $env:ProgramFiles; \ # (this archive has a "docker/..." directory in it already) diff --git a/shared.jq b/shared.jq index 372d77d20..a9f6b7e2e 100644 --- a/shared.jq +++ b/shared.jq @@ -57,10 +57,8 @@ def download(opts): wget -O \(opts.target | @sh) \"$url\";" , - if $notSha256 then "" else " - if [ -n \"${sha256:-}\" ]; then - echo \"$sha256 *\"\(opts.target | @sh) | sha256sum -c -; - fi;" + if $notSha256 or ($sha256 == null) then "" else " + echo \"$sha256 *\"\(opts.target | @sh) | sha256sum -c -;" end ] | add | rtrimstr(";") diff --git a/versions.sh b/versions.sh index ece501672..65af59e01 100755 --- a/versions.sh +++ b/versions.sh @@ -228,10 +228,10 @@ for version in "${versions[@]}"; do else continue fi - if checksum="$(_curl "$url.sha256")"; then - read -r sha256 filename <<< "$checksum" - if [[ ! "$sha256" =~ ^[[:xdigit:]]{64}$ ]] || [[ "$filename" != "${url##*/}" ]]; then - echo >&2 "error: invalid checksum for $url" + if sha256="$(_curl "$url.sha256")"; then + sha256="${sha256%% *}" + if [[ ! "$sha256" =~ ^[[:xdigit:]]{64}$ ]]; then + echo >&2 "error: invalid checksum for $url: '$sha256'" exit 1 fi @@ -252,26 +252,25 @@ for version in "${versions[@]}"; do amd64 | arm64v8) rootlessExtrasUrl="https://download.docker.com/linux/static/$channel/$arch/docker-rootless-extras-$fullVersion.tgz" if _curl --head "$rootlessExtrasUrl" > /dev/null; then - if rootlessExtrasChecksum="$(_curl "$rootlessExtrasUrl.sha256")"; then - read -r rootlessExtrasSha256 filename <<< "$rootlessExtrasChecksum" - if [[ ! "$rootlessExtrasSha256" =~ ^[[:xdigit:]]{64}$ ]] || [[ "$filename" != "${rootlessExtrasUrl##*/}" ]]; then - echo >&2 "error: invalid checksum for $rootlessExtrasUrl" + if rootlessExtrasSha256="$(_curl "$rootlessExtrasUrl.sha256")"; then + rootlessExtrasSha256="${rootlessExtrasSha256%% *}" + if [[ ! "$rootlessExtrasSha256" =~ ^[[:xdigit:]]{64}$ ]]; then + echo >&2 "error: invalid checksum for $rootlessExtrasUrl: '$rootlessExtrasSha256'" exit 1 fi - - export rootlessExtrasUrl rootlessExtrasSha256 - doc="$(jq <<<"$doc" -c ' - .arches[env.bashbrewArch] += { - rootlessExtrasUrl: env.rootlessExtrasUrl, - rootlessExtrasSha256: env.rootlessExtrasSha256, - } - ')" else - export rootlessExtrasUrl - doc="$(jq <<<"$doc" -c ' - .arches[env.bashbrewArch].rootlessExtrasUrl = env.rootlessExtrasUrl - ')" + rootlessExtrasSha256= fi + + export rootlessExtrasUrl rootlessExtrasSha256 + doc="$(jq <<<"$doc" -c ' + .arches[env.bashbrewArch] |= ( + .rootlessExtrasUrl = env.rootlessExtrasUrl + | if env.rootlessExtrasSha256 then + .rootlessExtrasSha256 = env.rootlessExtrasSha256 + end + } + ')" fi ;; esac From d64d5edf98cfe39e52896c7a0379838a5d13f8b8 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 10 Nov 2026 11:49:55 +0100 Subject: [PATCH 5/8] fixup! review suggestions Signed-off-by: Sebastiaan van Stijn --- shared.jq | 6 ++++-- versions.sh | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/shared.jq b/shared.jq index a9f6b7e2e..372d77d20 100644 --- a/shared.jq +++ b/shared.jq @@ -57,8 +57,10 @@ def download(opts): wget -O \(opts.target | @sh) \"$url\";" , - if $notSha256 or ($sha256 == null) then "" else " - echo \"$sha256 *\"\(opts.target | @sh) | sha256sum -c -;" + if $notSha256 then "" else " + if [ -n \"${sha256:-}\" ]; then + echo \"$sha256 *\"\(opts.target | @sh) | sha256sum -c -; + fi;" end ] | add | rtrimstr(";") diff --git a/versions.sh b/versions.sh index 65af59e01..4f7bc5ae3 100755 --- a/versions.sh +++ b/versions.sh @@ -266,10 +266,10 @@ for version in "${versions[@]}"; do doc="$(jq <<<"$doc" -c ' .arches[env.bashbrewArch] |= ( .rootlessExtrasUrl = env.rootlessExtrasUrl - | if env.rootlessExtrasSha256 then + | if env.rootlessExtrasSha256 != "" then .rootlessExtrasSha256 = env.rootlessExtrasSha256 end - } + ) ')" fi ;; From 18840163d0911d6ace81e9ec8ce3f33804c14b86 Mon Sep 17 00:00:00 2001 From: Sebastiaan van Stijn Date: Tue, 10 Nov 2026 12:18:26 +0100 Subject: [PATCH 6/8] regenerate dockerfiles Signed-off-by: Sebastiaan van Stijn --- 29-rc/windows/windowsservercore-ltsc2022/Dockerfile | 12 +++++------- 29-rc/windows/windowsservercore-ltsc2025/Dockerfile | 12 +++++------- 29/windows/windowsservercore-ltsc2022/Dockerfile | 12 +++--------- 29/windows/windowsservercore-ltsc2025/Dockerfile | 12 +++--------- 4 files changed, 16 insertions(+), 32 deletions(-) diff --git a/29-rc/windows/windowsservercore-ltsc2022/Dockerfile b/29-rc/windows/windowsservercore-ltsc2022/Dockerfile index aa1c8dfbf..0f6a7f5fd 100644 --- a/29-rc/windows/windowsservercore-ltsc2022/Dockerfile +++ b/29-rc/windows/windowsservercore-ltsc2022/Dockerfile @@ -17,17 +17,15 @@ RUN $newPath = ('{0}\docker;{1}' -f $env:ProgramFiles, $env:PATH); \ ENV DOCKER_VERSION 29.10.0-rc.1 ENV DOCKER_URL https://download.docker.com/win/static/test/x86_64/docker-29.10.0-rc.1.zip -ENV DOCKER_SHA256 "d3f21d8d1487ee8a0bc936cb65c5149b1f5bebe2d05499c6bcfdcd8b81030c7b" +ENV DOCKER_SHA256 d3f21d8d1487ee8a0bc936cb65c5149b1f5bebe2d05499c6bcfdcd8b81030c7b RUN Write-Host ('Downloading {0} ...' -f $env:DOCKER_URL); \ Invoke-WebRequest -Uri $env:DOCKER_URL -OutFile 'docker.zip'; \ \ - if ($env:DOCKER_SHA256) { \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ - if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ + if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ }; \ \ Write-Host 'Expanding ...'; \ diff --git a/29-rc/windows/windowsservercore-ltsc2025/Dockerfile b/29-rc/windows/windowsservercore-ltsc2025/Dockerfile index bcce05f7e..1518e5861 100644 --- a/29-rc/windows/windowsservercore-ltsc2025/Dockerfile +++ b/29-rc/windows/windowsservercore-ltsc2025/Dockerfile @@ -17,17 +17,15 @@ RUN $newPath = ('{0}\docker;{1}' -f $env:ProgramFiles, $env:PATH); \ ENV DOCKER_VERSION 29.10.0-rc.1 ENV DOCKER_URL https://download.docker.com/win/static/test/x86_64/docker-29.10.0-rc.1.zip -ENV DOCKER_SHA256 "d3f21d8d1487ee8a0bc936cb65c5149b1f5bebe2d05499c6bcfdcd8b81030c7b" +ENV DOCKER_SHA256 d3f21d8d1487ee8a0bc936cb65c5149b1f5bebe2d05499c6bcfdcd8b81030c7b RUN Write-Host ('Downloading {0} ...' -f $env:DOCKER_URL); \ Invoke-WebRequest -Uri $env:DOCKER_URL -OutFile 'docker.zip'; \ \ - if ($env:DOCKER_SHA256) { \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ - if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ + Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ + if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ + Write-Host 'FAILED!'; \ + exit 1; \ }; \ \ Write-Host 'Expanding ...'; \ diff --git a/29/windows/windowsservercore-ltsc2022/Dockerfile b/29/windows/windowsservercore-ltsc2022/Dockerfile index 30a89f76d..829713669 100644 --- a/29/windows/windowsservercore-ltsc2022/Dockerfile +++ b/29/windows/windowsservercore-ltsc2022/Dockerfile @@ -17,19 +17,13 @@ RUN $newPath = ('{0}\docker;{1}' -f $env:ProgramFiles, $env:PATH); \ ENV DOCKER_VERSION 29.9.3 ENV DOCKER_URL https://download.docker.com/win/static/stable/x86_64/docker-29.9.3.zip -ENV DOCKER_SHA256 "" +# TODO ENV DOCKER_SHA256 +# https://github.com/docker/docker-ce/blob/5b073ee2cf564edee5adca05eee574142f7627bb/components/packaging/static/hash_files !! +# (no SHA file artifacts on download.docker.com yet as of 2017-06-07 though) RUN Write-Host ('Downloading {0} ...' -f $env:DOCKER_URL); \ Invoke-WebRequest -Uri $env:DOCKER_URL -OutFile 'docker.zip'; \ \ - if ($env:DOCKER_SHA256) { \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ - if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ - }; \ - \ Write-Host 'Expanding ...'; \ Expand-Archive docker.zip -DestinationPath $env:ProgramFiles; \ # (this archive has a "docker/..." directory in it already) diff --git a/29/windows/windowsservercore-ltsc2025/Dockerfile b/29/windows/windowsservercore-ltsc2025/Dockerfile index d2714fc08..ef413a931 100644 --- a/29/windows/windowsservercore-ltsc2025/Dockerfile +++ b/29/windows/windowsservercore-ltsc2025/Dockerfile @@ -17,19 +17,13 @@ RUN $newPath = ('{0}\docker;{1}' -f $env:ProgramFiles, $env:PATH); \ ENV DOCKER_VERSION 29.9.3 ENV DOCKER_URL https://download.docker.com/win/static/stable/x86_64/docker-29.9.3.zip -ENV DOCKER_SHA256 "" +# TODO ENV DOCKER_SHA256 +# https://github.com/docker/docker-ce/blob/5b073ee2cf564edee5adca05eee574142f7627bb/components/packaging/static/hash_files !! +# (no SHA file artifacts on download.docker.com yet as of 2017-06-07 though) RUN Write-Host ('Downloading {0} ...' -f $env:DOCKER_URL); \ Invoke-WebRequest -Uri $env:DOCKER_URL -OutFile 'docker.zip'; \ \ - if ($env:DOCKER_SHA256) { \ - Write-Host ('Verifying sha256 ({0}) ...' -f $env:DOCKER_SHA256); \ - if ((Get-FileHash docker.zip -Algorithm sha256).Hash -ne $env:DOCKER_SHA256) { \ - Write-Host 'FAILED!'; \ - exit 1; \ - }; \ - }; \ - \ Write-Host 'Expanding ...'; \ Expand-Archive docker.zip -DestinationPath $env:ProgramFiles; \ # (this archive has a "docker/..." directory in it already) From 1654eeaa881af8bb00e97d6caf868f162c9dc73a Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 10 Nov 2026 14:33:55 -0800 Subject: [PATCH 7/8] More golf to remove `29/` changes --- 29-rc/cli/Dockerfile | 12 +++--------- 29-rc/dind-rootless/Dockerfile | 3 --- 29-rc/dind/Dockerfile | 4 +--- 29/cli/Dockerfile | 11 ++--------- 29/dind-rootless/Dockerfile | 3 --- 29/dind/Dockerfile | 3 --- shared.jq | 8 +++----- 7 files changed, 9 insertions(+), 35 deletions(-) diff --git a/29-rc/cli/Dockerfile b/29-rc/cli/Dockerfile index dde164fbb..4250919fb 100644 --- a/29-rc/cli/Dockerfile +++ b/29-rc/cli/Dockerfile @@ -57,9 +57,7 @@ RUN set -eux; \ esac; \ \ wget -O 'docker.tgz' "$url"; \ - if [ -n "${sha256:-}" ]; then \ - echo "$sha256 *"'docker.tgz' | sha256sum -c -; \ - fi; \ + echo "$sha256 *"'docker.tgz' | sha256sum -c -; \ \ tar --extract \ --file docker.tgz \ @@ -109,9 +107,7 @@ RUN set -eux; \ esac; \ \ wget -O 'docker-buildx' "$url"; \ - if [ -n "${sha256:-}" ]; then \ - echo "$sha256 *"'docker-buildx' | sha256sum -c -; \ - fi; \ + echo "$sha256 *"'docker-buildx' | sha256sum -c -; \ \ plugin='/usr/local/libexec/docker/cli-plugins/docker-buildx'; \ mkdir -p "$(dirname "$plugin")"; \ @@ -157,9 +153,7 @@ RUN set -eux; \ esac; \ \ wget -O 'docker-compose' "$url"; \ - if [ -n "${sha256:-}" ]; then \ - echo "$sha256 *"'docker-compose' | sha256sum -c -; \ - fi; \ + echo "$sha256 *"'docker-compose' | sha256sum -c -; \ \ plugin='/usr/local/libexec/docker/cli-plugins/docker-compose'; \ mkdir -p "$(dirname "$plugin")"; \ diff --git a/29-rc/dind-rootless/Dockerfile b/29-rc/dind-rootless/Dockerfile index 05ae04784..93e4eda43 100644 --- a/29-rc/dind-rootless/Dockerfile +++ b/29-rc/dind-rootless/Dockerfile @@ -37,9 +37,6 @@ RUN set -eux; \ esac; \ \ wget -O 'rootless.tgz' "$url"; \ - if [ -n "${sha256:-}" ]; then \ - echo "$sha256 *"'rootless.tgz' | sha256sum -c -; \ - fi; \ \ tar --extract \ --file rootless.tgz \ diff --git a/29-rc/dind/Dockerfile b/29-rc/dind/Dockerfile index fe309088e..a9331210f 100644 --- a/29-rc/dind/Dockerfile +++ b/29-rc/dind/Dockerfile @@ -83,9 +83,7 @@ RUN set -eux; \ esac; \ \ wget -O 'docker.tgz' "$url"; \ - if [ -n "${sha256:-}" ]; then \ - echo "$sha256 *"'docker.tgz' | sha256sum -c -; \ - fi; \ + echo "$sha256 *"'docker.tgz' | sha256sum -c -; \ \ tar --extract \ --file docker.tgz \ diff --git a/29/cli/Dockerfile b/29/cli/Dockerfile index 771a26fd2..9611e898e 100644 --- a/29/cli/Dockerfile +++ b/29/cli/Dockerfile @@ -45,9 +45,6 @@ RUN set -eux; \ esac; \ \ wget -O 'docker.tgz' "$url"; \ - if [ -n "${sha256:-}" ]; then \ - echo "$sha256 *"'docker.tgz' | sha256sum -c -; \ - fi; \ \ tar --extract \ --file docker.tgz \ @@ -97,9 +94,7 @@ RUN set -eux; \ esac; \ \ wget -O 'docker-buildx' "$url"; \ - if [ -n "${sha256:-}" ]; then \ - echo "$sha256 *"'docker-buildx' | sha256sum -c -; \ - fi; \ + echo "$sha256 *"'docker-buildx' | sha256sum -c -; \ \ plugin='/usr/local/libexec/docker/cli-plugins/docker-buildx'; \ mkdir -p "$(dirname "$plugin")"; \ @@ -145,9 +140,7 @@ RUN set -eux; \ esac; \ \ wget -O 'docker-compose' "$url"; \ - if [ -n "${sha256:-}" ]; then \ - echo "$sha256 *"'docker-compose' | sha256sum -c -; \ - fi; \ + echo "$sha256 *"'docker-compose' | sha256sum -c -; \ \ plugin='/usr/local/libexec/docker/cli-plugins/docker-compose'; \ mkdir -p "$(dirname "$plugin")"; \ diff --git a/29/dind-rootless/Dockerfile b/29/dind-rootless/Dockerfile index dd5189a7c..4d110a254 100644 --- a/29/dind-rootless/Dockerfile +++ b/29/dind-rootless/Dockerfile @@ -35,9 +35,6 @@ RUN set -eux; \ esac; \ \ wget -O 'rootless.tgz' "$url"; \ - if [ -n "${sha256:-}" ]; then \ - echo "$sha256 *"'rootless.tgz' | sha256sum -c -; \ - fi; \ \ tar --extract \ --file rootless.tgz \ diff --git a/29/dind/Dockerfile b/29/dind/Dockerfile index e7f7e2537..f23d1ca19 100644 --- a/29/dind/Dockerfile +++ b/29/dind/Dockerfile @@ -71,9 +71,6 @@ RUN set -eux; \ esac; \ \ wget -O 'docker.tgz' "$url"; \ - if [ -n "${sha256:-}" ]; then \ - echo "$sha256 *"'docker.tgz' | sha256sum -c -; \ - fi; \ \ tar --extract \ --file docker.tgz \ diff --git a/shared.jq b/shared.jq index 372d77d20..ed950bbb3 100644 --- a/shared.jq +++ b/shared.jq @@ -57,11 +57,9 @@ def download(opts): wget -O \(opts.target | @sh) \"$url\";" , - if $notSha256 then "" else " - if [ -n \"${sha256:-}\" ]; then - echo \"$sha256 *\"\(opts.target | @sh) | sha256sum -c -; - fi;" - end + if opts.sha256Key and all(opts.arches[]; has(opts.sha256Key)) then " + echo \"$sha256 *\"\(opts.target | @sh) | sha256sum -c -;" + else "" end ] | add | rtrimstr(";") | gsub("(?<=[^[:space:]])\n"; " \\\n") From 05330fd01ddd29e258fa92b0f6f4ca4dd0d74144 Mon Sep 17 00:00:00 2001 From: Tianon Gravi Date: Tue, 10 Nov 2026 15:26:59 -0800 Subject: [PATCH 8/8] Fix indentation --- versions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/versions.sh b/versions.sh index 4f7bc5ae3..0ef1ea359 100755 --- a/versions.sh +++ b/versions.sh @@ -269,7 +269,7 @@ for version in "${versions[@]}"; do | if env.rootlessExtrasSha256 != "" then .rootlessExtrasSha256 = env.rootlessExtrasSha256 end - ) + ) ')" fi ;;