如何列出ARM64的Docker图像?
我拥有Mac M1,然后在上面运行Docker。 在OSX上,Docker可以运行本地手臂图像,但还可以模拟X86/AMD64以运行未为ARM构建的图像。
从命令行中,如何找到显示图像平台的命令“ Docker Image LS”的扩展?
$ docker image ls
REPOSITORY TAG **PLATFORM** IMAGE ID CREATED SIZE
.............................arm64
.............................x86
我已经看到了这个答案:如何通过平台过滤码头图像?但这没有回答这个问题。操作系统和平台是两件事。
I own a Mac M1 and I run Docker on it.
On OSX, Docker can run native ARM images but also emulate x86/amd64 to run images that were not built for ARM.
From the command line, how do I find an extension of the command 'docker image ls' which displays the image platform?
$ docker image ls
REPOSITORY TAG **PLATFORM** IMAGE ID CREATED SIZE
.............................arm64
.............................x86
I already saw this answer: How to filter Docker images by platform? but it does NOT answer the question. OS and PLATFORM are two different things.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这是您想要的吗?
输出:
说明:
$(Docker Image LS -Q)
→将所有图像ID作为参数传递到检查命令Docker Image Inspect
打印有关图像的详细信息- 格式“ {{.id}} {{.repotags}}}} {{.architecture}}“
→仅打印必要的数据而不是完整的JSON,也可以使用
grep
{Inspect> {Inspect command} |添加管道。 EGREP'amd64 $'仅打印amd64
架构。Is this what you looking for?
output:
Explanation:
$(docker image ls -q)
→ pass all image IDs as parameters to inspect commanddocker image inspect
print detailed info about image--format "{{.ID}} {{.RepoTags}} {{.Architecture}}"
→ print only necessary data instead of full JSONAlso it is possible to add pipe with
grep
, like{inspect command} | egrep 'amd64$'
to print onlyamd64
architecture for example.尝试将
Docker Image
与JQ
:Try to combine
docker image
withjq
: