快捷菜单
常用功能一站直达
更多功能请点顶栏「快捷菜单」
如何下载一个国外的镜像?
以下面的例子为例:
要做一个NodeLocal DNSCache的实验,其中要使用k8s.gcr.io/dns/k8s-dns-node-cache:1.21.1镜像拉取pod。
[root[@master1 ]() ~]#vim nodelocaldns.yaml

因为这个k8s.gcr.io镜像仓库地址是国外的,我们这里访问不了,此时该如何解决呢?
先看下当前docker配置的进项源地址:
1[root@xyy admin]#cat /etc/docker/daemon.json
2{
3 "registry-mirrors":["https://kvuwuws2.mirror.aliyuncs.com","http://hub-mirror.c.163.com","https://dockerhub.azk8s.cn"]
4}
5[root@xyy admin]#
6
7
8[root@xyy admin]#docker info
9……
10 Registry: https://index.docker.io/v1/
11 …… 1[root@xyy admin]###docker pull k8s-dns-node-cache:1.21.1
2Error response from daemon: pull access denied for k8s-dns-node-cache, repository does not exist or may require 'docker login': denied: requested access to the resource is denied
3
4[root@xyy admin]###docker pull busybox
5Using default tag: latest
6latest: Pulling from library/busybox
73cb635b06aa2: Pull complete
8Digest: sha256:b5cfd4befc119a590ca1a81d6bb0fa1fb19f1fbebd0397f25fae164abe1e8a6a
9Status: Downloaded newer image for busybox:latest
10docker.io/library/busybox:latest
11
12[root@xyy admin]###docker images
13REPOSITORY TAG IMAGE ID CREATED SIZE
14busybox latest ffe9d497c324 3 weeks ago 1.24MBk8s-dns-node-cache:1.21.1镜像。1[root@xyy admin]###docker pull k8s.gcr.io/dns/k8s-dns-node-cache:1.21.1
2Error response from daemon: Get "https://k8s.gcr.io/v2/": net/http: request canceled while waiting for connection (Client.Timeout exceeded while awaiting headers)因为这个是国外镜像仓库地址,我们根本无法访问。
这个k8s.gcr.io网站无法访问,我们只能做镜像转存了。
可以先把镜像转存到自己的dockerhub账号,然后我们就可以正常拉取镜像了。
如何转存,请看如下方法。
一般的镜像转存:我们先把镜像拉取到本地,然后推送到自己的dockerhub账号就行。
本页暂无大纲内容
文章需要包含标题才能生成目录
日历 · 精选 · 友链 · 更多
如果内容对你有帮助,欢迎请我喝杯咖啡 ☕



One的公众号
爱折腾博客的小白