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.复制下面那段代码, ...
随机推荐
- oauth2.0学习笔记(摘抄简化)
大量摘抄白话简明教程. 附:可以参考<RFC6749协议中文版及oauth2.0>文档 一.OAuth 白话简明教程 1.简述 http://www.cnblogs.com/Ceri/p/ ...
- python多线程,多进程编程。
进程,是目前计算机中为应用程序分配资源的最小单位: 线程,是目前计算机中运行应用程序的最小单位: 在实际系统中,其实进程都是被分为线程来实现的,所以参与时间片轮转的是线程: 但是管理应用程序的资源的单 ...
- discuz用户组
非公众用户组当用户组设置为“非公众用户组”时,无论是以主用户组的形式,还是以扩展用户组的形式,均只能由管理员手工将用户加入本组. 公众用户组当本用户组设置为“公众用户组”,且用户当前所在的用户组被允许 ...
- Hadoop安装教程_单机/伪分布式配置_Hadoop2.6.0/Ubuntu14.04(转)
http://www.powerxing.com/install-hadoop/ http://blog.csdn.net/beginner_lee/article/details/6429146 h ...
- Python并发编程之线程池/进程池--concurrent.futures模块
一.关于concurrent.futures模块 Python标准库为我们提供了threading和multiprocessing模块编写相应的多线程/多进程代码,但是当项目达到一定的规模,频繁创建/ ...
- urlopen和urlretrieve
import urllib import re url = "https://www.duitang.com/search/?kw=%E9%AC%BC%E6%80%AA&type=f ...
- Python 监控脚本(硬盘、cpu、内存、网卡、进程)
#磁盘使用率disk = psutil.disk_partitions()for i in disk: print "磁盘:%s 分区格式:%s"%(i.device,i ...
- Android Camera2 Opengles2.0 实时滤镜(冷暖色/放大镜/模糊/美颜)
https://blog.csdn.net/keen_zuxwang/article/details/78363464 demo: http://download.csdn.net/download/ ...
- django的url配置
在一个请求到达的时候,最先达到的就是视图层,然后根据url映射到视图函数.这一部分我们来说明url的配置. 概述 为了给一个应用设计URL,你需要创建一个Python 模块,通常称为URLconf(U ...
- 获取微信access_token
/** * 获取微信access_token * @return mixed */function get_access_token() { $appId = C('APPID'); $secret ...