PLATFORM_NOT_SUPPORTED cicd build_error ai_generated true

构建失败:构建器实例不支持平台'linux/arm64/v8'

ERROR: failed to solve: platform 'linux/arm64/v8' not supported by the builder instance

ID: cicd/docker-buildx-platform-not-supported

其他格式: JSON · Markdown 中文 · English
83%修复率
89%置信度
1证据数
2024-05-22首次发现

版本兼容性

版本状态引入弃用备注
Docker 24.0 active
Buildx 0.12 active
QEMU 7.2 active
Linux x86_64 host active

根因分析

Docker Buildx构建器没有启用请求的平台(例如ARM64),或未安装用于跨平台构建的QEMU仿真。

English

Docker Buildx builder does not have the requested platform (e.g., ARM64) enabled or the QEMU emulation is not installed for cross-platform builds.

generic

官方文档

https://docs.docker.com/build/building/multi-platform/

解决方案

  1. Install QEMU binfmt support: `docker run --privileged --rm tonistiigi/binfmt --install all`, then create builder: `docker buildx create --name multiarch --driver docker-container --bootstrap`
  2. Use existing multiarch builder: `docker buildx use multiarch && docker buildx inspect --bootstrap` to verify platforms
  3. In CI, add step to setup QEMU: `uses: docker/setup-qemu-action@v3` and `uses: docker/setup-buildx-action@v3` before build

无效尝试

常见但无效的做法:

  1. 75% 失败

    Default driver doesn't support multi-platform builds at all; fails with different error.

  2. 40% 失败

    Avoids the error but defeats the purpose of multi-platform builds; doesn't fix builder configuration.

  3. 55% 失败

    Default builder may not include QEMU or ARM emulation; need explicit --driver-opt.