拉docker镜像用于不同的体系结构 [英] Pull docker image for different architecture
问题描述
我有一个空气隔离的系统,正在运行一些Docker容器.我正在尝试获取一些图像,但是系统与我正在运行的体系结构不同.对于一些图像(如GCC),我只能说 docker pull repo/gcc
,效果很好,但是由于某些原因,当我尝试执行 docker pull repo/python 代码>我得到:
I have an air gapped system that I'm running some docker containers on. I'm trying to get some images on it however the system is a different architecture than what I'm running. For a few images (like GCC) I was able to just say docker pull repo/gcc
and that worked fine, however for some reason when I try to do docker pull repo/python
I get:
Using default tag: latest
latest: Pulling from repo/python
no matching manifest for linux/amd64 in the manifest list entries
是否可以在请求请求中指定体系结构?
Is there a way to specify the architecture in my pull request?
推荐答案
要回答标题中的问题:您可以按摘要提取图像.
To answer question from the title: you can pull image by digest.
示例:列出所有受支持的体系结构(清单):
Example: list all supported architectures (manifest):
$ docker manifest inspect ckulka/multi-arch-example
{
"schemaVersion": 2,
"mediaType": "application/vnd.docker.distribution.manifest.list.v2+json",
"manifests": [
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 2200,
"digest": "sha256:6eaeab9bf8270ce32fc974c36a15d0bac4fb6f6cd11a0736137c4248091b3646",
"platform": {
"architecture": "amd64",
"os": "linux"
}
},
{
"mediaType": "application/vnd.docker.distribution.manifest.v2+json",
"size": 2413,
"digest": "sha256:f02e0fd2918a894ecd49d67b802c22082dc3c6424f6566e1753a83ba833b0993",
"platform": {
"architecture": "arm",
"os": "linux",
"variant": "v5"
}
},
...
然后按摘要操作,例如 arm
拱(在 linux
机器上拉):
And then pull by digest, e.g. arm
arch (pulled on linux
machine):
$ docker pull ckulka/multi-arch-example@sha256:f02e0fd2918a894ecd49d67b802c22082dc3c6424f6566e1753a83ba833b0993
但是您不能运行所有体系结构,因此当您为其他体系结构提取映像时,它可能会毫无用处.
But you can't run all architectures, so it can be useless when you pull image for different architecture.
这篇关于拉docker镜像用于不同的体系结构的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!