建立ARM64 Docker图像,其基本图像仅支持AMD64

发布于 2025-01-26 07:52:44 字数 2085 浏览 2 评论 0原文

我有一个带有M1的MacBook Pro,并且正在尝试测试是否可以使用仅通过指定-platform Linux/ARM64来支持AMD64的基本图像的ARM64图像。

我用摇杆/R-Ver:4.0.4(仅支持AMD64)进行了测试,并且能够使用以下命令构建,而没有任何错误,

docker build --platform linux/arm64 -t r-ver-arm64:test

我的Dockerfile只是来自Rocker/r-ver:4.0.4

但是,当我使用python测试:3.3-alpine3.4(仅支持AMD64)用命令

docker build --platform linux/arm64 -t python-arm64:test

dockerfile是来自python:3.3-alpine3.4

我有一个错误消息,我说没有匹配平台的匹配清单

[+] Building 1.3s (4/4) FINISHED                                                                                                                                  
 => [internal] load build definition from Dockerfile                                                                                                         0.0s
 => => transferring dockerfile: 207B                                                                                                                         0.0s
 => [internal] load .dockerignore                                                                                                                            0.0s
 => => transferring context: 34B                                                                                                                             0.0s
 => ERROR [internal] load metadata for docker.io/library/python:3.3-alpine3.4                                                                                1.2s
 => [auth] library/python:pull token for registry-1.docker.io                                                                                                0.0s
------
 > [internal] load metadata for docker.io/library/python:3.3-alpine3.4:
------
error: failed to solve: failed to solve with frontend dockerfile.v0: failed to create LLB definition: no match for platform in manifest sha256:32b65b0dd11df5fb4dcf1e0f6bb05007b6b84270959ab27b618b513321ef6d6a: not found

我不明白为什么它适用于r-ver:4.0.4基本图像,但对python:3.3-alpine3.4

有人可以帮助我吗?

I have a MacBook Pro with M1 and I am trying to test if I can build an ARM64 image with a base image that only supports AMD64 by specifying --platform linux/arm64.

I tested with rocker/r-ver:4.0.4(only supports AMD64) and was able to build with this command below without any error

docker build --platform linux/arm64 -t r-ver-arm64:test

my dockerfile is just FROM rocker/r-ver:4.0.4

But when I tested with python:3.3-alpine3.4(supports AMD64 only) with command

docker build --platform linux/arm64 -t python-arm64:test

Dockerfile is FROM python:3.3-alpine3.4

I've got an error message, saying no match for platform in manifest

[+] Building 1.3s (4/4) FINISHED                                                                                                                                  
 => [internal] load build definition from Dockerfile                                                                                                         0.0s
 => => transferring dockerfile: 207B                                                                                                                         0.0s
 => [internal] load .dockerignore                                                                                                                            0.0s
 => => transferring context: 34B                                                                                                                             0.0s
 => ERROR [internal] load metadata for docker.io/library/python:3.3-alpine3.4                                                                                1.2s
 => [auth] library/python:pull token for registry-1.docker.io                                                                                                0.0s
------
 > [internal] load metadata for docker.io/library/python:3.3-alpine3.4:
------
error: failed to solve: failed to solve with frontend dockerfile.v0: failed to create LLB definition: no match for platform in manifest sha256:32b65b0dd11df5fb4dcf1e0f6bb05007b6b84270959ab27b618b513321ef6d6a: not found

I don't understand why it works for r-ver:4.0.4 base image, but doesn't for python:3.3-alpine3.4

Could someone help me with it?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文