我有一个多拱构建,它正在推送到我正在运行的本地注册中心:
docker buildx build --platform linux/amd64,linux/arm64 --push -t localhost:5000/myimage:latest我需要将这个多拱图像导出到一个.tar文件中,以便将来与docker load一起使用。我不能为我的一生找到一个方法来做这件事。
我试过:
docker pull localhost:5000/myimage:latest
docker save -o myimage.tar localhost:5000/myimage:latest这只为我的架构(amd64)导出图像。于是我试着:
docker pull --platform linux/arm64 --platform linux/amd64 localhost:5000/myimage:latest
docker save -o myimage.tar localhost:5000/myimage:latest这有着同样的结果,尽管我明确地告诉它要把这两种架构都拉出来。
如何将多弓图像从本地注册表导出为单个.tar文件?
发布于 2022-09-01 05:18:02
这在码头博客上的多平台码头构建中得到了回答。对于您的特定情况,您将为您想要的每个平台执行一个构建和推送,然后创建一个清单文件并推送该文件。然后您可以执行保存。看起来会是这样的:
$ docker buildx build --platform linux/amd64 --push -t localhost:5000/myimage:amd64 .
$ docker buildx build --platform linux/arm64 --push -t localhost:5000/myimage:arm64 .
$ docker manifest create myimage:latest myimage:amd64 myimage:arm64
$ docker manifest push localhost:5000/myimage:latest
$ docker image save -o myimage.tar localhost:5000/myimage:latesthttps://devops.stackexchange.com/questions/16511
复制相似问题