Problem with intermediate Image in docker build for varying Architectures with same Base Image
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 5/5
- 预计耗时
- 一周以上
- 新手友好度
- 15/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- docker, python
- 领域
- build-system, devops
调研方向
未指定源文件或测试。首先重现 issue 中描述的并发 linux/arm/v7 和 linux/amd64 Docker 构建命令,然后检查 Docker 对中间镜像的处理,关注特定于平台的引用。只有提供了经过文档记录和验证的 workaround 或 fix,能够防止并发构建选择错误平台的镜像,才算完成。
由索引模型根据 Issue 内容生成。
描述
In my system, I need to create a large number of images for different devices with different architectures. For this, I have a pipeline that creates multiple images using Docker in Docker, all based on one Python:3.8 image, but for different architectures. In the Docker file, I specify the base image in general:
FROM python:3.8
In the build command, I specify the architecture of the particular device:
docker build --platform linux/arm/v7 --force-rm -t localhost:5000/ImageName
docker build --platform linux/amd64 --force-rm -t localhost:5000/ImageName
The problem I'm facing at the moment is that the Docker host gets confused with the images when the pipeline triggers both or more builds at the same time. Docker doesn't seem to be able to store intermediate images for different architectures because they only differ in digest and identical tags are overwritten. For this reason, docker only seems to select the intermediate image by the name and tag and not by the sha265: that matches the architecture. This results in the following error:
failed to get destination image "sha256:4d470a81cd7a4eb2a886d8d6ca7848d66f711ea2d44375f4ab10a97c42c1adf3": image with reference sha256: 4d470a81cd7a4eb2a886d8d6ca7848d66f711ea2d44375f4ab10a97c42c1adf3 was found but does not match the specified platform: wanted linux/arm/v7, actual: linux/amd64
Also the --force-rm option in the build command does not work here, because the deletion is done after the build process is finished. I also don't want to declare the images with @sha in the dockerfile, because the identical code should be used on different devices.
What is the best way to work around or solve this problem?
- 主要语言
- Markdown
- 星标
- 4.7k
- 派生
- 8.5k
- 平均合并
- 2 天 8 小时
- 30 天内合并 PR
- 129
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
docker/docs 的其他 Issue
-
难度 1/5 1 小时以内 新手友好度 84/100
维护者通常 1 天内回复
-
[docs-scanner] Inconsistent information about what gets deleted when Docker Offload v1 session ends可能重新可做 关联的 PR 已关闭且未合并。 未关闭
难度 1/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
-
status/triage
难度 1/5 1 小时以内 新手友好度 92/100
维护者通常 1 天内回复
-
[docs-scanner] Confusing explanation of approval-required outcome vs permit in MCP policy可能已有人在做 @dave123981 于 2 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 88/100
维护者通常 1 天内回复
-
[docs-scanner] Contradictory information about MCP approval fields in audit records可能已有人在做 @dave123981 于 2 天前认领。 未关闭
难度 1/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复
相似的 Issue
-
backend prio:low
难度 2/5 1-3 小时 新手友好度 76/100
digitalfabrik/entitlementcard#3262 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
apache/cordova-ios#1751 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
area/automation area/sdk kind/bug
难度 2/5 1-3 小时 新手友好度 78/100
unoplatform/uno.templates#2406 ·
维护者通常 1 天内回复
-
good first issue help wanted
难度 1/5 1 小时以内 新手友好度 84/100
servo/rust-smallvec#864 ·