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/ 常用 ...
随机推荐
- 最短路Dijkstra算法模板
// // dijkstra妯℃澘.cpp // algorithm // // Created by david.xu on 2018/8/6. // Copyright 漏 2018骞?david ...
- 【LC_Lesson3】---回文数的判别
判断一个整数是否是回文数.回文数是指正序(从左向右)和倒序(从右向左)读都是一样的整数. 示例 1: 输入: 121 输出: true 示例 2: 输入: -121 输出: false 解释: 从左向 ...
- dp-LCS(递归输出最短合串)
Problem Description The company "21st Century Fruits" has specialized in creating new sort ...
- crawler 听课笔记 碎碎念 1 初步了解各种选择器极其简单的使用
css中 身份证 id对应# 衣服 class对应 . 图片 pyquery...as pq html= request.get(url=''.....'') doc=pq(html) d ...
- requests请求
requests:伪造浏览器请求 请求 1.get requests.get( url='', params={ 'k1': ''v1, 'k2': 'v2' } ) 即 url?k1=k2& ...
- Java入门 - 高级教程 - 03.泛型
原文地址:http://www.work100.net/training/java-generic.html 更多教程:光束云 - 免费课程 泛型 序号 文内章节 视频 1 概述 2 泛型方法 3 泛 ...
- [bzoj2120] [洛谷P1903] 数颜色
Description 墨墨购买了一套N支彩色画笔(其中有些颜色可能相同),摆成一排,你需要回答墨墨的提问.墨墨会像你发布如下指令: 1. Q L R代表询问你从第L支画笔到第R支画笔中共有几种不同颜 ...
- CentOS7 zabbix4.0搭建配置
一.Zabbix-Server服务器端的安装 概述:10050是Agent的端口,Agent采用被动方式,Server主动连接Agent的10050端口:10051是Server的端口,Agent采用 ...
- 浅谈openresty
浅谈openresty 为什么会有OpenResty? 我们都知道Nginx有很多的特性和好处,但是在Nginx上开发成了一个难题,Nginx模块需要用C开发,而且必须符合一系列复杂的规则,最重要的用 ...
- 一个基于RabbitMQ的可复用的事务消息方案
前提 分布式事务是微服务实践中一个比较棘手的问题,在笔者所实施的微服务实践方案中,都采用了折中或者规避强一致性的方案.参考Ebay多年前提出的本地消息表方案,基于RabbitMQ和MySQL(JDBC ...