Docker加速器使用时不需要任何额外操作。就像这样下载官方Ubuntu镜像
实际操作(添加镜像源):
在 /etc/sysconfig/docker下添加两条命令
<code>other_args=</code><code>"--registry-mirror=http://74ecfe5d.m.daocloud.io"</code>
<code>OPTIONS='--registry-mirror=</code>
<code>http:</code><code>//74ecfe5d</code><code>.m.daocloud.io'</code>
重启Docker服务,让配置生效:
<code>[root@docker ~]</code><code># /etc/init.d/docker restart</code>
<code>Stopping docker: [ OK ]</code>
<code>Starting docker: [ OK ]</code>
<code>[root@docker ~]</code><code># echo $?</code>
<code>0</code>
测试查找ubuntu镜像,并下载一个pull镜像:
<code>[root@docker ~]</code><code># docker search ubuntu</code>
NAME DESCRIPTION STARS OFFICIAL AUTOMATED
ubuntu Ubuntu is a Debian-based Linux operating s... 3234 [OK]
ubuntu-upstart Upstart is an event-based replacement for ... 60 [OK]
torusware/speedus-ubuntu Always updated official Ubuntu docker imag... 25 [OK]
ubuntu-debootstrap debootstrap --variant=minbase --components... 25 [OK]
tleyden5iwx/ubuntu-cuda Ubuntu 14.04 with CUDA drivers pre-installed 20 [OK]
rastasheep/ubuntu-sshd Dockerized SSH service, built on top of of... 20 [OK]
nickistre/ubuntu-lamp-wordpress LAMP on Ubuntu with wp-cli installed 4 [OK]
nuagebec/ubuntu Simple always updated Ubuntu docker images... 4 [OK]
nimmis/ubuntu This is a docker images different LTS vers... 3 [OK]
maxexcloo/ubuntu Docker base image built on Ubuntu with Sup... 2 [OK]
nickistre/ubuntu-lamp LAMP server on Ubuntu 2 [OK]
densuke/ubuntu-jp-remix Ubuntu Linuxの日本語remix風味です 2 [OK]
sassmann/ubuntu-steam Steam based on Ubuntu 1 [OK]
seetheprogress/ubuntu Ubuntu image provided by seetheprogress us... 1 [OK]
darksheer/ubuntu Base Ubuntu Image -- Updated hourly 1 [OK]
teamrock/ubuntu TeamRock's Ubuntu image configured with AW... 0 [OK]
konstruktoid/ubuntu Ubuntu base image 0 [OK]
webhippie/ubuntu Docker images for ubuntu 0 [OK]
esycat/ubuntu Ubuntu LTS 0 [OK]
rallias/ubuntu Ubuntu with the needful 0 [OK]
lynxtp/ubuntu https://github.com/lynxtp/docker-ubuntu 0 [OK]
avatao/ubuntu Ubuntu for challenges 0 [OK]
ubuntucore/jenkins-ubuntu Jenkins image based on ubuntu 0 [OK]
zoni/ubuntu 0 [OK]
jianhuiz/ubuntu-docker ubuntu images that runs in nova-docker 0 [OK]
<code>[root@docker ~]</code><code># docker pull ubuntu</code>
Pulling repository ubuntu
c29e52d44f69: Download complete
5549154b6b00: Download complete
dbcf09c742a7: Download complete
40964da1bf47: Download complete
Status: Downloaded newer image for ubuntu:latest
查看镜像信息:
<code>[root@docker ~]</code><code># docker images</code>
<code>REPOSITORY TAG IMAGE ID CREATED VIRTUAL SIZE</code>
<code>ubuntu latest c29e52d44f69 3 days ago 187.9 MB</code>
<code>wordpress latest 62a9acf5fc2a 9 days ago 517.3 MB</code>
<code>nginx latest bbb75b846e7b 9 days ago 134.5 MB</code>
<code>redis latest 34ca6ac180ad 3 weeks ago 151.2 MB</code>
<code>mongo latest ad74160b3443 3 weeks ago 317.4 MB</code>
<code>daocloud.io</code><code>/library/python</code> <code>latest a2db1214d015 3 weeks ago 689.1 MB</code>
<code>debian latest 5eb1402f0414 3 weeks ago 125.1 MB</code>
<code>centos latest 60e65a8e4030 8 weeks ago 196.6 MB</code>
<code>joedval</code><code>/stress</code> <code>latest 7eb627cb08a2 11 weeks ago 214.9 MB</code>
<code>lemonbar</code><code>/centos6-ssh</code> <code>latest b78c71c001db 18 months ago </code>
本文转自 冰冻vs西瓜 51CTO博客,原文链接:http://blog.51cto.com/molewan/1743799,如需转载请自行联系原作者