我有一个气隙系统,正在其上运行一些 docker 容器。我正在尝试获取一些图像,但是该系统的架构与我正在运行的系统不同。对于一些图像(例如 GCC),我只能说docker pull repo/gcc并且效果很好,但是由于某种原因,当我尝试这样做时,docker pull repo/python我得到:
Using default tag: latest
latest: Pulling from repo/python
no matching manifest for linux/amd64 in the manifest list entries
Run Code Online (Sandbox Code Playgroud)
有没有办法在我的拉取请求中指定架构?
ste*_*718 120
使用最新的 docker,您可以在拉取时指定平台
docker pull --platform linux/arm64 alpine:latest
Run Code Online (Sandbox Code Playgroud)
Jan*_*raj 13
从标题回答问题:您可以通过摘要提取图像。
示例:列出所有支持的架构(清单):
$ 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"
}
},
...
Run Code Online (Sandbox Code Playgroud)
然后通过摘要拉取,例如armarch(在linux机器上拉取):
$ docker pull ckulka/multi-arch-example@sha256:f02e0fd2918a894ecd49d67b802c22082dc3c6424f6566e1753a83ba833b0993
Run Code Online (Sandbox Code Playgroud)
但是你不能运行所有的架构,所以当你为不同的架构拉取镜像时它可能没有用。
| 归档时间: |
|
| 查看次数: |
10693 次 |
| 最近记录: |