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.复制下面那段代码, ...
随机推荐
- “编程利器”:VSCode
原先一直使用sublime text3,并且认为它是很好的编程利器. 但最近写代码时,发现很多代码还是提示的不够完整.我们知道,当代码名字很长时,还没有提醒,这是非常苦恼的一件事!同时它的调试功能也不 ...
- 排序(I)
NSSortDescriptor 排序 Person类 #import <Foundation/Foundation.h> @interface Person : NSObject @pr ...
- Spark学习之路 (三)Spark之RDD
一.RDD的概述 1.1 什么是RDD? RDD(Resilient Distributed Dataset)叫做弹性分布式数据集,是Spark中最基本的数据抽象,它代表一个不可变.可分区.里面的元素 ...
- 大数据处理框架之Strom: Storm拓扑的并行机制和通信机制
一.并行机制 Storm的并行度 ,通过提高并行度可以提高storm程序的计算能力. 1.组件关系:Supervisor node物理节点,可以运行1到多个worker,不能超过supervisor. ...
- Spring NoSuchBeanDefinitionException
转http://www.baeldung.com/spring-nosuchbeandefinitionexception 1. Overview In this article, we are di ...
- Codeforce 507B - Amr and Pins
Amr loves Geometry. One day he came up with a very interesting problem. Amr has a circle of radius r ...
- python+selenium win32gui实现文件上传 enumerate()
upload = dr.find_element_by_id('exampleInputFile0') upload.click() time.sleep(1) # win32gui dialog = ...
- 怎样从外网访问内网php-fpm?
本地安装了一个php-fpm,只能在局域网内访问,怎样从外网也能访问到本地的php-fpm呢?本文将介绍具体的实现步骤. 准备工作 安装并启动php-fpm 默认安装的php-fpm端口是9000. ...
- K8S学习笔记之二进制的方式创建一个Kubernetes集群
0x00 单节点搭建和简述 minikube Minikube是一个工具,可以在本地快速运行一个单点的Kubernetes,尝试Kubernetes或日常开发的用户使用.不能用于生产环境. 官方地址: ...
- js增加、删除、替换DOM对象
当网页被加载时,浏览器会创建页面的文档对象模型DOM,即Document Object Model 整个文档为一个文档节点(document对象) 每个html元素为一个元素节点(element对象) ...