Skip to content

如何下载国外镜像

如何下载一个国外的镜像?

以下面的例子为例:

要做一个NodeLocal DNSCache的实验,其中要使用k8s.gcr.io/dns/k8s-dns-node-cache:1.21.1镜像拉取pod。

[root[@master1 ]() ~]#vim nodelocaldns.yaml

img

因为这个k8s.gcr.io镜像仓库地址是国外的,我们这里访问不了,此时该如何解决呢?

  • 我们这里尝试从本地配置的国内镜像源及dockerhub镜像源拉取进项看是否可以拉取成功?

先看下当前docker配置的进项源地址:

bash
[root@xyy admin]#cat /etc/docker/daemon.json {"registry-mirrors":["https:}[root@xyy admin]#[root@xyy admin]#docker info……Registry:https:……
  • 我们这里尝试拉取下镜像,看下效果:
bash
[root@xyy admin]###docker pull k8s-dns-node-cache:1.21.1Errorresponsefromdaemon:pullaccessdeniedfork8s-dns-node-cache,repositorydoesnotexistormayrequire'docker login':denied:requestedaccesstotheresourceisdenied[root@xyy admin]###docker pull busyboxUsingdefaulttag:latestlatest:Pullingfromlibrary/busybox3cb635b06aa2:PullcompleteDigest:sha256:b5cfd4befc119a590ca1a81d6bb0fa1fb19f1fbebd0397f25fae164abe1e8a6aStatus:Downloadednewerimageforbusybox:latestdocker.io/library/busybox:latest[root@xyy admin]###docker imagesREPOSITORYTAGIMAGEIDCREATEDSIZEbusyboxlatestffe9d497c3243weeksago1.24MB
  • 由现象可以看出,目前配置的all镜像源没有该k8s-dns-node-cache:1.21.1镜像。
  • 我们再使用原镜像地址拉取下镜像,看下效果:
bash
[root@xyy admin]###docker pull k8s.gcr.io/dns/k8s-dns-node-cache:1.21.1Errorresponsefromdaemon:Get"https:

版权:此文章版权归 One 所有,如有转载,请注明出处!

链接:可点击右上角分享此页面复制文章链接

上次更新时间:

最近更新