docker push 指定架构问题。

1次阅读

共计 762 个字符,预计需要花费 2 分钟才能阅读完成。

想要把一些镜像 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 的时候,感觉还是发起了一次网络请求。

正文完
 0