Skip to content

fix(deploy): fall back to unfiltered export for legacy single-platform images - #4282

Open
Zzzxxxxy wants to merge 1 commit into
mainfrom
fix/offline-export-platform-fallback
Open

Zzzxxxxy wants to merge 1 commit into
mainfrom
fix/offline-export-platform-fallback

Conversation

@Zzzxxxxy

@Zzzxxxxy Zzzxxxxy commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

问题 / Problem

v2.8.3.1 tag 的 build-offline-package(amd64 + arm64 两个 job)在同一处失败:

Error response from daemon: no suitable export target found:/nimage with reference supabase/postgres:15.8.1.060 was found but
does not provide the specified platform (linux/amd64)

#4277 给 docker save 加了 --platform 过滤,但 supabase/postgres:15.8.1.060 这类遗留单平台镜像的平台标注不匹配任何标准平台:docker pull --platform 静默拉下唯一可用版本(不报错),而 docker save --platform 严格校验直接失败,导致整个离线包构建中止。

#4277 added a --platform filter to docker save, but legacy single-platform images such as supabase/postgres:15.8.1.060 carry a platform annotation that never matches linux/amd64 or linux/arm64 exactly: docker pull --platform silently lands the only available variant, then docker save --platform aborts the whole offline package with no suitable export target found.

修复 / Fix

save_image_to_tar 在带 --platform 的导出失败且 daemon 支持平台导出时,降级为不带平台过滤重试一次。pull 阶段已经锁定了变体,无过滤的 save 导出的正是本包要发的内容。不支持平台导出的旧 Docker 保持单次尝试行为。

When the filtered export fails and the daemon supports platform export, save_image_to_tar retries once without the platform filter. The pull step already pinned the variant, so the unfiltered save ships exactly what the package intends. Docker without platform export support keeps its single-attempt behaviour.

验证 / Verification

  • bash -n 语法通过
  • 用复现 CI 失败模式的 fake docker 本地验证:过滤 save 失败 → 降级 save 成功 → tar 正确写出
  • test_offline_image_export.py 新增两个回归:降级重试成功路径 + 旧 Docker 不降级路径(本机沙箱无法执行临时目录脚本,pytest 需 CI 验证)

Fixes the offline-package failures in runs 41414643797 (amd64 + arm64).

…m images

#4277 made offline export pin docker save --platform, but legacy
single-platform images such as supabase/postgres:15.8.1.060 carry a
platform annotation that never matches linux/amd64 or linux/arm64
exactly: docker pull --platform silently lands the only available
variant, then docker save --platform aborts the whole offline package
with 'no suitable export target found'. Both the amd64 and arm64
package builds failed at exactly this image.

Retry the export without the platform filter when the filtered save
fails and the daemon supports platform export: the pull step already
pinned the variant, so the unfiltered save ships exactly what this
package intends. Docker without platform export support keeps its
single-attempt behaviour.

Verified locally with a fake docker that reproduces the CI failure:
filtered save fails, fallback save succeeds, tar is written.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant