由于国内访问直接访问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 配置阿里云镜像加速器的更多相关文章

  1. CentOS6.8上Docker配置阿里云镜像加速器

    1.打开网站https://dev.aliyun.com,点击管理中心,登录阿里云账号(没有的可以注册,也可以用淘宝等第三方账号登录). 2.点击镜像加速器,复制加速器地址 3.配置本机Docker运 ...

  2. Docker配置阿里云镜像加速器及开启远程连接

    适用于CentOS-7版本 mkdir /etc/docker vim /etc/docker/deamon.json 添加以下内容配置镜像 { "registry-mirrors" ...

  3. Linux系统Docker配置阿里云镜像加速器

    vim /etc/docker/daemon.json # 替换为 "registry-mirrors": ["https://v2ltjwbg.mirror.aliyu ...

  4. docker添加阿里云镜像加速器

    .docker添加阿里云镜像加速器 https://blog.csdn.net/chenjin_chenjin/article/details/86674521 .配置阿里云加速器 阿里云会根据账号生 ...

  5. Docker配置阿里云镜像加速pull

    前言:默认Docker拉取镜像是从Docker Hub上拉取,但由于防火墙的原因,导致镜像下载非常慢.为了提高拉取镜像的速度,可以配置阿里镜像或是网易镜像加速,通过使用经验推荐配置阿里镜像. 申请个人 ...

  6. 02--Docker配置阿里云镜像加速器

    1.登录阿里云控制台,在产品与服务中收索 "容器镜像服务" 2.点击镜像加速器,CentOS 3.在路径 /etc/docker/daemon.json 下配置加速器地址 4.重新 ...

  7. docker 系列之 配置阿里云镜像加速器

    1.登录阿里云 2.登录后找到右上角的“管理中心”,点击进入后>点击“镜像加速器”;剩下的安装文档配置就好 问题1:配置完后还是提示:Tag latest not found in reposi ...

  8. docker配置阿里云镜像加速

    一.登录阿里云控制台,并打开镜像加速器页面,复制加速器地址 二.修改daemon配置文件/etc/docker/daemon.json ,将复制的地址按照如下格式写入文件,若存在多行,使用逗号分隔. ...

  9. ubuntu下Docker配置阿里云镜像加速

    1.确认正确安装好docker,登录阿里云,打开如下界面 https://cr.console.aliyun.com/cn-hangzhou/instances/mirrors 2.复制下面那段代码, ...

随机推荐

  1. spring自带的定时任务功能@EnableScheduling

    1 demo package com.test.domi.config; import org.springframework.beans.factory.annotation.Configurabl ...

  2. ASCII 码

    http://baike.baidu.com/link?url=Y4crTsVq678Z8fr92DAGIrqVHoexVXsMc-WKBMVUKGDq4KbEOuhWbUQXuQEtnlom4yln ...

  3. skynet对Windows环境支持的版本:Windows版skynet

    https://github.com/sanikoyes/skynet.git Skynet Skynet is a lightweight online game framework, and it ...

  4. MySql 存储过程 退出

    mysql不支持quit, exit或return的方式退出编写存储过程时,为了业务规则需要,我们可能需要提前退出存储过程那么,我们可以利用leave label方式模拟实现quit退出的效果应用示例 ...

  5. VIM For Windows 1

    some tips for using vim in windows. 1,download the software vim and install it, you can go to the Of ...

  6. 线程安全的CopyOnWriteArrayList

    证明CopyOnWriteArrayList是线程安全的 先写一段代码证明CopyOnWriteArrayList确实是线程安全的. ReadThread.java import java.util. ...

  7. zabbix 监控项(key)

    Key 描述 返回值 参数 详细说明 agent.hostname 返回被监控端名称 字符串 - 返回配置文件中配置的被监控端的名称 agent.ping 检测被监控端是否存活 1 - 运行中 其他 ...

  8. MySQL底层索引剖析

    1:Mysql索引是什么 mysql索引: 是一种帮助mysql高效的获取数据的数据结构,这些数据结构以某种方式引用数据,这种结构就是索引.可简单理解为排好序的快速查找数据结构.如果要查“mysql” ...

  9. 使用Holer远程桌面登录家里电脑和公司内网电脑

    1. Holer工具简介 Holer exposes local servers behind NATs and firewalls to the public internet over secur ...

  10. Eloquent JavaScript #12# Handling Events

    索引 Notes onclick removeEventListener Event objects stopPropagation event.target Default actions Key ...