Docker 配置阿里云镜像加速器
由于国内访问直接访问docker hub网速比较慢,拉取镜像的时间就会比较长。一般我们会使用镜像加速或者直接从国内的一些平台镜像仓库上拉取。
根据网上提供的方案,有网易,daocloud,ustc等解决方案,但是最后还是选择了阿里云的。
网易镜像中心:https://c.163.com/hub#/m/home/
daocloud镜像市场:https://hub.daocloud.io/
阿里云 - 开发者平台:https://dev.aliyun.com/
阿里云 - 容器Hub服务控制台:https://cr.console.aliyun.com/
注册并登陆阿里云 - 开发者平台之后,在首页点击“创建我的容器镜像”,然后就会来到阿里云的服务面板。点击加速器标签。
根据提示输入Docker登录时需要使用的密码(后期可更改),用户名就是登录阿里云的用户名。
在出现的页面中,可以得到一个专属的镜像加速地址,类似于“https://1234abcd.mirror.aliyuncs.com”。
根据页面中的“操作文档”信息,配置自己的Docker加速器。
或者,登录阿里云 - 容器Hub服务控制台之后,点击加速器标签,也会出现相应信息。
[root@localhost /]# mkdir -p /etc/docker
[root@localhost /]# tee /etc/docker/daemon.json <<-'EOF'
> {
> "registry-mirrors": ["https://tqvgn51t.mirror.aliyuncs.com"]
> }
> EOF
{
"registry-mirrors": ["https://tqvgn53t.mirror.aliyuncs.com"]
}
[root@localhost /]# systemctl daemon-reload
[root@localhost /]# systemctl restart docker
上面命令里面配置的专属地址是假的,请大家不要照抄。
查看:
[root@localhost hongdada]# docker info
Containers:
Running:
Paused:
Stopped:
Images:
Server Version: 1.13.
Storage Driver: overlay2
Backing Filesystem: xfs
Supports d_type: false
Native Overlay Diff: true
Logging Driver: journald
Cgroup Driver: systemd
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: inactive
Runtimes: docker-runc runc
Default Runtime: docker-runc
Init Binary: docker-init
containerd version: (expected: aa8187dbd3b7ad67d8e5e3a15115d3eef43a7ed1)
runc version: N/A (expected: 9df8b306d01f59d3a8029be411de015b7304dd8f)
init version: N/A (expected: 949e6facb77383876aeff8a6944dde66b3089574)
Security Options:
seccomp
WARNING: You're not using the default seccomp profile
Profile: /etc/docker/seccomp.json
Kernel Version: 3.10.-693.21..el7.x86_64
Operating System: CentOS Linux (Core)
OSType: linux
Architecture: x86_64
Number of Docker Hooks:
CPUs:
Total Memory: 975.2 MiB
Name: localhost.localdomain
ID: 2QP3:PYDM:BLLS:P5QS:QGJN:N7GK:DAKV:ZWFG:FW54:FHS4:FCAN:6NR4
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/
Registry Mirrors:
https://tqvgn51t.mirror.aliyuncs.com
Live Restore Enabled: false
Registries: docker.io (secure)
看看加粗的地方,就是你的阿里云的专属加速器地址
从阿里云拉取,推送镜像操作:https://cr.console.aliyun.com/?spm=5176.1971733.0.2.MUp3vN#/imageList
登录阿里云docker registry:
$ sudo docker login --username=hongda159505@qq.com registry.cn-hangzhou.aliyuncs.com
登录registry的用户名是您的阿里云账号全名,密码是您开通服务时设置的密码。
你可以在镜像管理首页点击右上角按钮修改docker login密码。
从registry中拉取镜像:
$ sudo docker pull registry.cn-hangzhou.aliyuncs.com/hongdada/job1:[镜像版本号]
将镜像推送到registry:
$ sudo docker login --username=hongda159505@qq.com registry.cn-hangzhou.aliyuncs.com
$ sudo docker tag [ImageId] registry.cn-hangzhou.aliyuncs.com/hongdada/job1:[镜像版本号]
$ sudo docker push registry.cn-hangzhou.aliyuncs.com/hongdada/job1:[镜像版本号]
其中[ImageId],[镜像版本号]请你根据自己的镜像信息进行填写。
https://blog.csdn.net/u014231523/article/details/61197945
https://ieevee.com/tech/2016/09/28/docker-mirror.html
https://www.jianshu.com/p/1a4025c5f186
https://www.cnblogs.com/anliven/p/6218741.html
Docker 配置阿里云镜像加速器的更多相关文章
- CentOS6.8上Docker配置阿里云镜像加速器
1.打开网站https://dev.aliyun.com,点击管理中心,登录阿里云账号(没有的可以注册,也可以用淘宝等第三方账号登录). 2.点击镜像加速器,复制加速器地址 3.配置本机Docker运 ...
- Docker配置阿里云镜像加速器及开启远程连接
适用于CentOS-7版本 mkdir /etc/docker vim /etc/docker/deamon.json 添加以下内容配置镜像 { "registry-mirrors" ...
- Linux系统Docker配置阿里云镜像加速器
vim /etc/docker/daemon.json # 替换为 "registry-mirrors": ["https://v2ltjwbg.mirror.aliyu ...
- docker添加阿里云镜像加速器
.docker添加阿里云镜像加速器 https://blog.csdn.net/chenjin_chenjin/article/details/86674521 .配置阿里云加速器 阿里云会根据账号生 ...
- Docker配置阿里云镜像加速pull
前言:默认Docker拉取镜像是从Docker Hub上拉取,但由于防火墙的原因,导致镜像下载非常慢.为了提高拉取镜像的速度,可以配置阿里镜像或是网易镜像加速,通过使用经验推荐配置阿里镜像. 申请个人 ...
- 02--Docker配置阿里云镜像加速器
1.登录阿里云控制台,在产品与服务中收索 "容器镜像服务" 2.点击镜像加速器,CentOS 3.在路径 /etc/docker/daemon.json 下配置加速器地址 4.重新 ...
- docker 系列之 配置阿里云镜像加速器
1.登录阿里云 2.登录后找到右上角的“管理中心”,点击进入后>点击“镜像加速器”;剩下的安装文档配置就好 问题1:配置完后还是提示:Tag latest not found in reposi ...
- docker配置阿里云镜像加速
一.登录阿里云控制台,并打开镜像加速器页面,复制加速器地址 二.修改daemon配置文件/etc/docker/daemon.json ,将复制的地址按照如下格式写入文件,若存在多行,使用逗号分隔. ...
- ubuntu下Docker配置阿里云镜像加速
1.确认正确安装好docker,登录阿里云,打开如下界面 https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors 2.复制下面那段代码, ...
随机推荐
- sql 查询每科的前三名
废话不多说,直接上脚本 CREATE TABLE [dbo].[Students]( ,) NOT NULL, ) NULL, ) NULL, [score] [int] NOT NULL, CONS ...
- Unity之fragment shader中如何获得视口空间中的坐标
2种方法: 1. 使用 VPOS 或 WPOS语义,如: Shader "Test/ScreenPos1" { SubShader { Pass { CGPROGRAM #prag ...
- HDU 6298
Problem Description Given an integer n, Chiaki would like to find three positive integers x, y and z ...
- linux基本格式和常用目录命令一
1: cd 绝对路径 2: cd 相对路径 名字开头 ./开头 ../开头 3: cd ~: 去到当前用户所在目录; 4: pwd获取当前的路径的绝对路径; 5: ls 与ls -l 6: cat 操 ...
- Discuz! 安装模板、插件提示“对不起,您安装的不是正版应用...
iscuz 社区在更新到2.0以上后,增加了对插件的版本检测,在安装时,可能会出现:“对不起,您安装的不是正版应用,安装程序无法继续执行”的提示,要解决这个其实挺容易的,找到以下文件: /source ...
- python 数据较大 性能分析
前提:若有一个几百M的文件需要解析,某个函数需要运行很多次(几千次),需要考虑性能问题 性能分析模块:cProfile 使用方法:cProfile.run("func()"),其中 ...
- POI以SAX方式解析Excel2007大文件(包含空单元格的处理) Java生成CSV文件实例详解
http://blog.csdn.net/l081307114/article/details/46009015 http://www.cnblogs.com/dreammyle/p/5458280. ...
- poj1741 树上的分治
题意是说给了n个点的树n<=10000,问有多少个点对例如(a,b)他们的之间的距离小于等于k 采用树的分治做 #include <iostream> #include <cs ...
- JavaScript 基础,登录验证
1.<script></script>的三种用法: a.放在<body>中 b.放在<head>中 c.放在外部JS文件中 <!DOCTYPE h ...
- 常见的原生javascript DOM操作
1.创建元素 创建元素:document.createElement() 使用document.createElement()可以创建新元素.这个方法只接受一个参数,即要创建元素的标签名.这个标签名在 ...