docker阿里云镜像加速器使用
加速器使用:加快镜像下载速度
访问www.aliyun.com:

登录之后点击”控制台“,选择“产品与服务“:
选择“容器镜像服务“:
设定密码后选择“镜像加速器”:
这里会有一个加速器地址:
在/etc/docker目录下新建文件daemon.json将加速器地址写入:
[root@foundation17 docker]# vim daemon.json
1 {
2 "registry-mirrors": ["https://eqcxmbvw.mirror.aliyuncs.com"]
3 }
之后重启服务:
[root@foundation17 docker]# systemctl daemon-reload
[root@foundation17 docker]# systemctl restart docker
搜索docker镜像,如果能搜到表示加速器搭建成功:
[root@foundation17 docker]# docker search nginxNAME DESCRIPTION STARS OFFICIAL AUTOMATEDnginx Official build of Nginx. 9307 [OK] jwilder/nginx-proxy Automated Nginx reverse proxy for docker c... 1385 [OK]richarvey/nginx-php-fpm Container running Nginx + PHP-FPM capable ... 609 [OK]jrcs/letsencrypt-nginx-proxy-companion LetsEncrypt container to use with nginx as... 396 [OK]kong Open-source Microservice & API Management ... 215 [OK] webdevops/php-nginx Nginx with PHP-FPM 111
通过docker pull指令获取所需要的镜像,这样使用加速器下载镜像就比直接在官网下载快多了:
[root@foundation17 docker]# docker pull nginx
Using default tag: latest
latest: Pulling from library/nginx
be8881be8156: Downloading [> ] 224.9 kB/22.49 MB
32d9726baeef: Downloading [> ] 222.1 kB/22.14 MB
87e5e6f71297: Download complete
镜像使用:以nginx为例
下载好镜像之后将镜像导入本地docker仓库并运行:
[root@foundation17 docker]# docker load -i nginx.tar
cdb3f9544e4c: Loading layer [==================================================>] 58.44 MB/58.44 MB
a8c4aeeaa045: Loading layer [==================================================>] 54.24 MB/54.24 MB
08d25fa0442e: Loading layer [==================================================>] 3.584 kB/3.584 kB
Loaded image: nginx:latest
[root@foundation17 docker]# docker run -d --name vm2 nginx
8aff7c1c564bfa154e7d70d721cc730397b4ca058da7810fc65dbec75ab21e24
查看nginx所使用的ip地址:
[root@foundation17 docker]# docker inspect vm2
功访问:
这种情况下新建的nginx首页文件需要复制到nginx默认发布目录下,每次更新都要重新复制比较麻烦:
root@foundation17 docker]# docker cp index.html vm2:/usr/share/nginx/html/
为了能够将更改的首页文件即时刷新到nginx服务端,需要新建目录并挂载到nginx的默认发布目录下,挂载时候需要重新开启nginx服务,所以需要先删除原来的nginx服务:
[root@foundation17 web]# docker rm -f vm2
vm2
或者不删除,重新开启一个nginx服务进程,但这个进程的ip就不再是172.17.0.2了,访问时要访问新的ip。
新建目录并挂载到nginx默认发布目录:
[root@foundation17 docker]# mkdir /tmp/docker/web -p
[root@foundation17 web]# docker run -d --name vm4 -v /tmp/docker/web/:/usr/share/nginx/html nginx
053b9a24cf3d2431d9e5b7913f5575520c7c7849ca732c3ebf7d228e69e14d55
在/tmp/docker/web目录下新建index.html首页文件,就可以即时刷新到nginx服务端了:

docker阿里云镜像加速器使用的更多相关文章
- docker 阿里云镜像加速器
传送门:阿里云镜像地址 Ubuntu/CentOS 安装/升级你的Docker客户端 推荐安装1..0以上版本的Docker客户端,参考文档 docker-ce 如何配置镜像加速器 针对Docker客 ...
- Docker阿里云镜像加速器 for CentOS 7
CentOS 7 CentOS使用配置方式略微复杂,需要先将默认的配置文件复制出来 /lib/systemd/system/docker.service -> /etc/systemd/syst ...
- docker添加阿里云镜像加速器
.docker添加阿里云镜像加速器 https://blog.csdn.net/chenjin_chenjin/article/details/86674521 .配置阿里云加速器 阿里云会根据账号生 ...
- Docker安装及阿里云镜像加速器配置
Docker安装 Windows系统安装就不用说了,因为Docker是开源的,所以,直接去官网:https://www.docker.com/下载安装包安装就行了 其实,Linux系统安装也很简单,照 ...
- Docker配置阿里云镜像加速器及开启远程连接
适用于CentOS-7版本 mkdir /etc/docker vim /etc/docker/deamon.json 添加以下内容配置镜像 { "registry-mirrors" ...
- 附001.Docker阿里云Registry加速器配置
一 安装配置docker 1.1 安装docker 见<002.docker版本及安装>. 1.2 配置国内阿里云加速器 见<002.docker版本及安装>. 二 配置阿里云 ...
- Docker阿里云镜像加速
登录阿里云docker registry sudo docker login --username=zhangsan@163.com registry.cn-hangzhou.aliyuncs.com ...
- Docker 阿里云镜像加速
1.进入阿里云镜像加速页面: https://cr.console.aliyun.com/#/accelerator 2.修改/etc/docker/daemon.json文件配置,没有则新建: ? ...
- Docker阿里云镜像存储服务
阿里云镜像服务地址 https://cr.console.aliyun.com/cn-beijing/instances/repositories 免费免费免费 登陆之后可以免费创建,仓库.地址大 ...
随机推荐
- __next__和__iter__实现迭代器协议
---恢复内容开始--- #_*_coding:utf-8_*_ __author__ = 'Linhaifeng' class Foo: def __init__(self,x): self.x=x ...
- python性能测试脚本-乾颐堂
废话不多说,直接上代码. import httplib import urllib import time import json class Transaction(object): ...
- python实现中文字符繁体和简体中文转换-乾颐堂
需求:把中文字符串进行繁体和简体中文的转换: 思路:引入简繁体处理库,有兴趣的同学可以研究一下内部实现,都是python写的 1.下载zh_wiki.py及langconv zh_wiki.py:ht ...
- 中介者模式c#(媒婆版)
using System;using System.Collections.Generic;using System.Linq;using System.Text; namespace 中介者模式{ ...
- vue项目 菜单侧边栏随着右侧内容盒子的高度实时变化
测试的时候发现,在选择模板.选择产品第二步第三步的时候.如果超出两行的话会盖住看不见,(因为高度所有统一都被写死了,又加了overflow~emmm~)所以要改成走马灯形式.如图: 那么问题来了,我步 ...
- 借用服务器百度BAE
3一.简介 对于普通的开发者,不必要买服务器和买域名,这时要将自己的项目传到服务器上,就用到了百度BAE这样的,可以直接传项目的服务器. 二.申请 登录百度开放平台上 三.登录网址,选择要使用的项目 ...
- ASIHTTPRequest-Cookie的使用[转]
ASIHTTPRequest允许你使用全局存储来和所有使用CFNetwork或者NSURLRequest接口的程序共享cookie. 如果设置useCookiePersistence为YES(默认值) ...
- 关于wcf配置未启动net.tcp监控导致无法访问wcf
在服务里面启动NetTcpActivator和NetTcpPortSharing服务
- cxrichedit导入WORD
cxrichedit导入WORD word := CreateOLEObject('Word.Application'); word.Documents.Open(l_path,false); w ...
- ASP.NET Core2集成Office Online Server(OWAS)实现办公文档的在线预览与编辑(支持word\excel\ppt\pdf等格式)
Office Online Server是微软开发的一套基于Office实现在线文档预览编辑的技术框架(支持当前主流的浏览器,且浏览器上无需安装任何插件,支持word.excel.ppt.pdf等文档 ...