V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
justdoit123
V2EX  ›  Docker

docker push 指定架构问题。

  •  
  •   justdoit123 · 8 天前 · 847 次点击

    想要把一些镜像 push 到自己搭建的私有源上。正常的步骤应该是:

    1. 从公开源拉取镜像 docker pull xxx-public/redis:v1.2.3
    2. 重新打一个 tag ,指向私有源 docker tag xxx-public/redis:v1.2.3 yyy-private/redis:v1.2.3
    3. 推送到私有源上。docker push yyy-private/redis:v1.2.3

    但是,镜像是多架构的。而默认情况下,pull 只会拉取本机对应的 CPU 架构。因此导致上述第 3 步失败:

    ❯ docker push yyy-private/redis:v1.2.3
    The push refers to repository [yyy-private]
    missing content: content digest sha256:b5cd220f882a6d678d2f85acfa9331c0ab87ca584ac9825556171d2460296b55: not found
    Note: You're trying to push a manifest list/index which references multiple platform specific manifests, but not all of them are available locally or available to the remote repository.
    Make sure you have all the referenced content and try again.
    

    两个问题:

    1. 是不是只有通过 docker manifest inspect 命令,查看一个镜像有多少种架构。然后把所有架构的版本都 pull 到本地后,才能 push 到私有源上?

    2. 镜像的完整 manifest 存在哪里?运行 docker manifest inspect 的时候,感觉还是发起了一次网络请求。

    第 1 条附言  ·  7 天前
    感谢各位。

    crane copy 真好用! skopeo 暂时没试过。
    4 条回复    2024-09-09 11:10:11 +08:00
    justdoit123
        1
    justdoit123  
    OP
       8 天前
    forte
        2
    forte  
       8 天前 via Android   ❤️ 1
    kimera
        3
    kimera  
       8 天前 via iPhone   ❤️ 1
    justdoit123
        4
    justdoit123  
    OP
       7 天前
    感谢~ @forte @kimera 我去尝试一下。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   951 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 21ms · UTC 22:48 · PVG 06:48 · LAX 15:48 · JFK 18:48
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.