Docker / Kubernetes 镜像源

Azure 中国镜像源地址:http://mirror.azure.cn/
Azure 中国镜像源 Github 地址:https://github.com/Azure/container-service-for-azure-china
镜像源配置说明:http://mirror.azure.cn/help/gcr-proxy-cache.html
中科大镜像源地址:http://mirrors.ustc.edu.cn/
中科大镜像源 Github 地址:https://github.com/ustclug/mirrorrequest
镜像源配置说明:https://github.com/ustclug/mirrorrequest/issues/187
使用镜像源加速 Docker.io 镜像仓库
如果在 Docker 官方仓库拉取的是官方镜像,拉取方法类似如下:
$ docker pull xxx:yyy
使用中科大镜像源,应该类似这样拉取:
$ docker pull docker.mirrors.ustc.edu.cn/library/xxx:yyy
使用 Azure 中国镜像源,应该类似这样拉取:
$ docker pull dockerhub.azk8s.cn/library/xxx:yyy
如果在 Docker 官方仓库拉取的镜像是私有仓库
拉取方法类似如下:
$ docker pull xxx/yyy:zz
使用中科大镜像源,应该类似这样拉取:
$ docker pull docker.mirrors.ustc.edu.cn/xxx/yyy:zz
使用 Azure 中国镜像源,应该类似这样拉取:
$ docker pull dockerhub.azk8s.cn/xxx/yyy:zz
- 演示一个使用镜像源拉取的实例
# 使用中科大镜像源 $ docker pull docker.mirrors.ustc.edu.cn/library/mysql:5.7
$ docker pull docker.mirrors.ustc.edu.cn/360cloud/wayne
# 使用 Azure 中国镜像源 $ docker pull dockerhub.azk8s.cn/library/mysql:5.7
$ docker pull dockerhub.azk8s.cn/360cloud/wayne
注:首次拉取时可能会有 Error:image library/mysql:5.7 not found 类似报错,这说明镜像源中没有缓存该镜像。这个属于正常现像,因为加速镜像都是先从官方镜像仓库进行拉取的,然后缓存到本地。遇到这种情况,你可以尝试多拉取几次即可。
使用镜像源加速 gcr.io 镜像仓库
- 如果拉取的 Google 镜像仓库中容器镜像类似如下:
$ docker pull gcr.io/xxx/yyy:zzz 使用中科大镜像源,应该类似这样拉取:
$ docker pull gcr.mirrors.ustc.edu.cn/xxx/yyy:zzz 使用 Azure 中国镜像源,应该类似这样拉取:
$ docker pull gcr.azk8s.cn/xxx/yyy:zzz
- 演示一个使用镜像源拉取的实例
下面我们以拉取 gcr.io/kubernetes-helm/tiller:v2.9.1 为例: # 使用中科大镜像源
$ docker pull gcr.mirrors.ustc.edu.cn/kubernetes-helm/tiller:v2.9.1 # 使用 Azure 中国镜像源
$ docker pull gcr.azk8s.cn/kubernetes-helm/tiller:v2.9.1
使用镜像源加速 k8s.gcr.io 镜像仓库
- 如果我们拉取的 Kubernetes 所需容器镜像类似以下形式:
$ docker pull k8s.gcr.io/xxx:yyy
# 相当于$ docker pull gcr.io/google-containers/xxx:yyy 使用中科大镜像源,应该类似这样拉取:
$ docker pull gcr.mirrors.ustc.edu.cn/google-containers/xxx:yyy 使用 Azure 中国镜像源,应该类似这样拉取:
$ docker pull gcr.azk8s.cn/google-containers/xxx:yyy
- 演示一个使用镜像源拉取的实例
# 使用中科大镜像源
$ docker pull gcr.mirrors.ustc.edu.cn/google-containers/addon-resizer:1.8.
# 使用 Azure 中国镜像源
$ docker pull gcr.azk8s.cn/google-containers/addon-resizer:1.8.
使用镜像源加速 quay.io 镜像仓库
- 如果我们拉取的 quay.io 下所需容器镜像类似以下形式:
$ docker pull quay.io/xxx/yyy:zzz 使用中科大镜像源,应该类似这样拉取:
$ docker pull quay.mirrors.ustc.edu.cn/xxx/yyy:zzz 使用 Azure 中国镜像源,应该类似这样拉取:
$ docker pull quay.azk8s.cn/xxx/yyy:zzz
- 演示一个使用镜像源拉取的实例
# 使用中科大镜像源
$ docker pull quay.mirrors.ustc.edu.cn/coreos/kube-state-metrics:v1.5.0
# 使用 Azure 中国镜像源
$ docker pull quay.azk8s.cn/coreos/kube-state-metrics:v1.5.0
一些自动化工具
docker-wrapper
docker-wrapper 安装
$ git clone https://github.com/silenceshell/docker-wrapper.git
$ sudo cp docker-wrapper/docker-wrapper.py /usr/local/bin/ docker-wrapper 使用
$ docker-wrapper pull k8s.gcr.io/kube-apiserver:v1.14.1
$ docker-wrapper pull gcr.io/google_containers/kube-apiserver:v1.14.1
$ docker-wrapper pull nginx
$ docker-wrapper pull silenceshell/godaddy:0.0.
azk8spull
azk8spull 安装
$ git clone https://github.com/xuxinkun/littleTools$ cd littleTools
$ chmod +x install.sh
$ ./install.sh azk8spull 使用
$ azk8spull quay.io/kubernetes-ingress-controller/nginx-ingress-controller:0.24.
$ azk8spull k8s.gcr.io/pause-amd64:3.1
参考文档
- https://www.google.com
- https://ieevee.com/tech/2019/03/02/azure-gcr-proxy.html
- https://www.cnblogs.com/xuxinkun/p/11025020.html
- https://www.ilanni.com/?p=14534
Docker / Kubernetes 镜像源的更多相关文章
- docker 国内镜像源
参考:docker 国内镜像源 作者:Joncc Linux环境 # vi /etc/docker/daemon.json { "registry-mirrors": [" ...
- docker改变镜像源
sudo echo “DOCKER_OPTS=\”\$DOCKER_OPTS –registry-mirror=http://your-id.m.daocloud.io -d\”” >> ...
- Docker国内镜像源设置
编辑json文件,添加如下内容后重启docker即可. [root@Docker ~]# cat /etc/docker/daemon.json{ "registry-mirrors&quo ...
- Docker CE 镜像源站
sudo apt-get update sudo apt-get -y install apt-transport-https ca-certificates curl software-proper ...
- docker国内镜像源
https://www.daocloud.io/mirror curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http ...
- 替换 Docker 或 Laradock 中 Debian 系统镜像源解决软件安装问题
Docker Debian 镜像源替换 因多数默认的 Docker 镜像为国外的,而采用的镜像源也是国外的,故访问很慢,所以我们需要替换为国内的(比如阿里云或163等). 163 - Debian A ...
- docker镜像源设置
由于docker默认镜像源为国外官方源,下载速度较慢.设置国内镜像源可加速 修改文件 /etc/docker/daemon.json vi /etc/docker/daemon.json 添加以下内容 ...
- docker配置国内阿里云镜像源
使用docker默认镜像源下载镜像会很慢,因此很多情况下,我们在安装完docker以后都会修改为国内的镜像,这样在下载镜像的时候就不用等那么长时间了. 配置docker的镜像为阿里云镜像 方法一 $ ...
- Docker之镜像地址
转载自https://www.cnblogs.com/doraman/p/9570891.html 官方docker hub 官方:https://hub.docker.com/explore/ 常用 ...
随机推荐
- hdfs断电报错解决
一,/home/hadoop/tmp/dfs/name/current 目录下查看文件二,1.stop hadoop所有的服务;2.重新格式化namenode即可: hadoop根目录下: hadoo ...
- C# 实现验证码识别,使用AspriseOCR.dll
验证码(Captcha)基于十道安全栅栏, 为网页.App.小程序开发者打造立体.全面的人机验证,最大程度地保护注册登录.活动秒杀.点赞发帖.数据保护等各大场景下的业务安全.要做自动化脚本程序,就要能 ...
- Java入门 - 高级教程 - 03.泛型
原文地址:http://www.work100.net/training/java-generic.html 更多教程:光束云 - 免费课程 泛型 序号 文内章节 视频 1 概述 2 泛型方法 3 泛 ...
- 《大道至简》第一章Java伪代码读后感
/*写程序,实际是一种方法论.从另外一个角度帮我们看待世界,看清事物的本质. 早在两千年前的寓言中,愚公和智叟的问答中就已体现整个工程的实现程序.*/ public class 移山{ string ...
- 将一条路由约束到一组指定的值 约束路由 URL路由
- 使用属性创建区域 (Creating Areas with Attributes) | 使用区域 | 高级路由特性 | 精通ASP-NET-MVC-5-弗瑞曼
- 各种反弹shell方法总结
获取shell的方法总结: shell分为两种,一种是正向shell,另一种是反向shell.如果客户端连接服务器,客户端主动连接服务器,就称为正向shell.如果客户端连接服务器,服务器想要获得客户 ...
- 如何从Serilog请求日志记录中排除健康检查终结点
这是在ASP.NET Core 3.X中使用Serilog.AspNetCore系列文章的第四篇文章:. 第1部分-使用Serilog RequestLogging减少日志详细程度 第2部分-使用Se ...
- postman的简单介绍及运用
postman下载地址 https://www.getpostman.com/downloads/ postman的工作原理:发送请求给服务器,服务器处理postman发送的数据然后返回给postma ...
- Linux防火墙之iptables入门
一.防火墙的概念 什么是防火墙?防火墙是一台或一组设备,用以在网络间实施访问控制策略:事实上一个防火墙能够包含OSI模型中的很多层,并且可能会涉及进行数据包过滤的设备,它可以实施数据包检查和过滤,在更 ...