基于 mainfest 合并多架构 docker镜像

xincuni Docker评论319字数 795阅读2分39秒阅读模式

前言:

镜像合并,合并镜像的manifest

镜像合并前提: 即将要合并的镜像必须存在于镜像仓库

步骤

  1. 修改 docker配置 增加镜像仓库配置,必须添加端口
vim /etc/docker/daemon.json
...
"insecure-registries": ["cncp.io","172.16.125.61:80"],

....
  1. 将镜像拉取到本地

  2. 合并

docker manifest create --insecure 合并后的镜像 tag  镜像 A 镜像 B

4.把 manifest 推送到镜像


docker manifest push  --insecure 合并后的镜像 tag 

tips

before=zookeeper:3.8.0
nowrepo=172.16.125.61:80/dadi/public
now_tag_arm64=$before-arm64
now_tag_amd64=$before-amd64

docker pull  $before --platform amd64
docker tag $before $nowrepo/$now_tag_amd64
docker push $nowrepo/$now_tag_amd64

docker pull $before --platform arm64
docker tag $before $nowrepo/$now_tag_arm64
docker push $nowrepo/$now_tag_arm64

docker manifest create --insecure $nowrepo/$before  $nowrepo/$now_tag_amd64  $nowrepo/$now_tag_arm64

docker manifest push --insecure $nowrepo/$before


同样如果hub.docker.com存在不同cpu 的镜像,可以使用 docker buildx 一次性上传到镜像仓库,不需要合并 mainfest

文章末尾固定信息
weinxin
我的微信
微信扫一扫
匿名

发表评论

匿名网友 填写信息

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: