由于众所周知的原因,从Docker Hub难以高效地下载镜像。

除了使用VPN或代理之外,最为有效的方式就是使用Docker国内镜像。

DaoCloud是首个提供国内免费Docker Hub镜像的团体,可以使用DaoCloud团队提供的Docker Hub Mirror服务。

Docker加速器简介

Docker加速器是 DaoCloud 推出的 Docker Hub Mirror 服务的官方名称。

Docker加速器提供Docker Registry(Docker Hub)在中国的镜像代理服务,为中国用户在国内服务器上缓存诸多镜像。

当用户的Docker设定了--registry-mirror参数后,用户的Docker拉取镜像时,首先去Docker加速器中查找镜像,若命中则说明该镜像已经在Docker加速器中缓存,用户直接从Docker加速器中下载。

若没有命中,则说该镜像还没有被缓存,那么Docker加速器首先会被驱使去Docker Hub中下载该镜像,并进行缓存,最终让用户从Docker加速器中下载该镜像。

Docker加速器使用说明

DaoCloud注册并登录。

在登录后的页面(https://dashboard.daocloud.io/),点击“加速器”标签,根据新弹出的页面中“配置 Docker 加速器”信息,更改自己的 Docker 配置文件,然后重启Docker,使之生效。

注意:此时,从“配置 Docker 加速器”信息中,我们其实已经得到一个免费的docker镜像地址,类似于“http://abcd1234.m.daocloud.io”。

示例:配置及使用Docker加速器

这里以Linux系统为例。

Linux
curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://abcd1234.m.daocloud.io
该脚本可以将 --registry-mirror 加入到你的 Docker 配置文件中。
适用于 Ubuntu14.04、Debian、CentOS6 、CentOS7、Fedora、Arch Linux、openSUSE Leap 42.1,其他版本可能有细微不同。

注意:将http://abcd1234.m.daocloud.io替换为实际的链接。

更多详情请访问文档

配置Docker加速器

[root@CentOS-7 ~]# uname -a
Linux CentOS-7 3.10.0-327.el7.x86_64 #1 SMP Thu Nov 19 22:10:57 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
[root@CentOS-7 ~]#
[root@CentOS-7 ~]# cat /etc/redhat-release
CentOS Linux release 7.2.1511 (Core)
[root@CentOS-7 ~]#
[root@CentOS-7 ~]# curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://abcd1234.m.daocloud.io
Success.
You need to restart docker to take effect: sudo systemctl restart docker
[root@CentOS-7 ~]#
[root@CentOS-7 ~]# systemctl restart docker
[root@CentOS-7 ~]#

使用Docker加速器拉取镜像

[root@CentOS-7 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
[root@CentOS-7 ~]#
[root@CentOS-7 ~]# docker run ubuntu
Unable to find image 'ubuntu:latest' locally
Trying to pull repository docker.io/library/ubuntu ...
latest: Pulling from docker.io/library/ubuntu
b3e1c725a85f: Pull complete
4daad8bdde31: Pull complete
63fe8c0068a8: Pull complete
4a70713c436f: Pull complete
bd842a2105a8: Pull complete
Digest: sha256:dbe36a89ad8daf8bbd2a68f14eab18b969d3f125104da51df6337bbf08d1c8ae
Status: Downloaded newer image for docker.io/ubuntu:latest
[root@CentOS-7 ~]#
[root@CentOS-7 ~]# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
docker.io/ubuntu latest 104bec311bcd 8 days ago 128.9 MB
[root@CentOS-7 ~]#

Docker - 配置DaoCloud的Docker加速器的更多相关文章

  1. Docker - 配置DaoCloud的Docker加速器(国内registry-mirror)

    由于众所周知的原因,从Docker Hub难以高效地下载镜像. 除了使用VPN或代理之外,最为有效的方式就是使用Docker国内镜像. DaoCloud是首个提供国内免费Docker Hub镜像的团体 ...

  2. Docker配置daocloud加速器

    首先注册daocloud网站的账号(免费的!!!),并登陆自己的账号,并在这里获取自己的daocloud加速器配置脚本. 获取到自己的daocloud加速器配置脚本之后只需要在已安装Docker服务的 ...

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

    由于国内访问直接访问docker hub网速比较慢,拉取镜像的时间就会比较长.一般我们会使用镜像加速或者直接从国内的一些平台镜像仓库上拉取. 根据网上提供的方案,有网易,daocloud,ustc等解 ...

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

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

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

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

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

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

  7. Docker 配置国内镜像加速器,加速下载速度

    文章首发自个人微信公众号:小哈学Java 个人网站地址:https://www.exception.site/docker/docker-configuration-of-mirror-acceler ...

  8. centos为docker配置加速器

    国内拉去docker镜像慢得可怜,为了解决这个问题,可为docker配置加速器. 1.修改daemon配置文件 sudo mkdir -p /etc/dockervim /etc/docker/dae ...

  9. 为docker配置国内镜像加速器

    docker官方镜像仓库地址为:https://hub.docker.com/search?q=&type=image 因为是国外地址,因此下载镜像时速度很慢. 我们需要配置国内镜像加速, 可 ...

随机推荐

  1. js中的数据类型有

  2. 作业注释 CSS表单1 输入框前有图片

    <!DOCTYPE html><html lang="en"><head> <meta charset="UTF-8" ...

  3. 167. Two Sum II - Input array is sorted (Array)

    Given an array of integers that is already sorted in ascending order, find two numbers such that the ...

  4. PHP安装linux

    PHP 7.1.26 安装 1. 下载安装包 例php-7.1.26.tar.gz 下载地址:http://cn2.php.net/downloads.php 2. 放入/root 3. 切换目录 # ...

  5. 转:centos查看实时网络带宽占用情况方法

    Linux中查看网卡流量工具有iptraf.iftop以及nethogs等,iftop可以用来监控网卡的实时流量(可以指定网段).反向解析IP.显示端口信息等. centos安装iftop的命令如下: ...

  6. Centos7编译安装lnmp(nginx1.10 php7.0.2)

    我使用的是阿里云的服务器 Centos7 64位的版本 1. 连接服务器 这个是Xshell5的版本 安装好之后我们开始连接服务器 2. 安装nginx 首先安装nginx的依赖 yum instal ...

  7. 582. Kill Process杀死所有子代

    [抄题]: Given n processes, each process has a unique PID (process id) and its PPID (parent process id) ...

  8. Spark官方文档翻译(一)~Overview

    Spark官方文档翻译,有问题请及时指正,谢谢. Overview页 http://spark.apache.org/docs/latest/index.html Spark概述 Apache Spa ...

  9. 解决 ora-28001 密码过期的处理办法

    转载自:https://blog.csdn.net/pengyouchuan/article/details/12905623 操作步骤: $sqlplus / as sysdba ALTER PRO ...

  10. 记一次Java Core Dump分析过程

    #背景提要 很久没有亲自动手部署代码了,命令行的亲切感越来越低.放飞了键盘,习惯了鼠标操作的windows环境.冷不丁实操部署也是不错的. 常常在部署时,运维同学对于[hs_err_pid]文件视而不 ...