docker 镜像中的默认平台类型是什么?

发布于 2025-01-19 11:53:01 字数 170 浏览 3 评论 0原文

dockerFile命令FROM中从docker hub加载镜像时,如果没有指定平台,是根据当前服务器架构加载的吗?

我的意思是,当我在 amazon linux 2 x86 上构建 dockerfile 时,docker 引擎是否获得可以在 linux/x86-64 上运行的 docker 映像? 谢谢你!!

When loading an image from a docker hub in dockerFile command FROM, if the platform is not specified, is it loaded based on the current server architecture?

I mean, when I build dockerfile on amazon linux 2 x86, is docker engine get docker image which can running on linux/x86-64?
Thank you!!

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

故笙诉离歌 2025-01-26 11:53:01

Docker构建默认设置以使用您正在构建的目标平台的平台提取基本图像。该目标平台默认为Docker主机的平台。因此,如果您的Docker引擎在Linux/AMD64上运行,并且您不通过- 平台docker build或 from line,它将尝试从多平台基础图像中汲取Linux/AMD64图像。

您可以通过运行:

docker system info --format '{{.OSType}}/{{.Architecture}}'

The docker build defaults to pulling base images with the platform of the target platform you are building. And that target platform defaults to the platform of your docker host. So if your docker engine is running on linux/amd64, and you do not pass --platform to either docker build or the FROM line, it will attempt to pull linux/amd64 images from a multi platform base image.

You can check your docker host by running:

docker system info --format '{{.OSType}}/{{.Architecture}}'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文