系统环境:centos7.2

1、安装docker

[root@localhost~]#yum -y install docker

2、搜索centos基本的镜像

[root@localhost docker]# docker search centos
INDEX NAME DESCRIPTION STARS OFFICIAL AUTOMATED
docker.io docker.io/centos The official build of CentOS. 5281 [OK]
docker.io docker.io/ansible/centos7-ansible Ansible on Centos7 121 [OK]
docker.io docker.io/jdeathe/centos-ssh CentOS-6 6.10 x86_64 / CentOS-7 7.5.1804 x... 108 [OK]
docker.io docker.io/consol/centos-xfce-vnc Centos container with "headless" VNC sessi... 83 [OK]
docker.io docker.io/imagine10255/centos6-lnmp-php56 centos6-lnmp-php56 53 [OK]
docker.io docker.io/centos/mysql-57-centos7 MySQL 5.7 SQL database server 50
docker.io docker.io/tutum/centos Simple CentOS docker image with SSH access 44
docker.io docker.io/gluster/gluster-centos Official GlusterFS Image [ CentOS-7 + Glu... 40 [OK]
docker.io docker.io/openshift/base-centos7 A Centos7 derived base image for Source-To... 40
docker.io docker.io/centos/postgresql-96-centos7 PostgreSQL is an advanced Object-Relationa... 37
docker.io docker.io/centos/python-35-centos7 Platform for building and running Python 3... 34
docker.io docker.io/kinogmt/centos-ssh CentOS with SSH 26 [OK]
docker.io docker.io/centos/httpd-24-centos7 Platform for running Apache httpd 2.4 or b... 22
docker.io docker.io/centos/php-56-centos7 Platform for building and running PHP 5.6 ... 20
docker.io docker.io/openshift/jenkins-2-centos7 A Centos7 based Jenkins v2.x image for use... 20
docker.io docker.io/pivotaldata/centos-gpdb-dev CentOS image for GPDB development. Tag nam... 10
docker.io docker.io/openshift/wildfly-101-centos7 A Centos7 based WildFly v10.1 image for us... 6
docker.io docker.io/openshift/jenkins-1-centos7 DEPRECATED: A Centos7 based Jenkins v1.x i... 4
docker.io docker.io/darksheer/centos Base Centos Image -- Updated hourly 3 [OK]
docker.io docker.io/pivotaldata/centos Base centos, freshened up a little with a ... 3
docker.io docker.io/pivotaldata/centos-mingw Using the mingw toolchain to cross-compile... 2
docker.io docker.io/blacklabelops/centos CentOS Base Image! Built and Updates Daily! 1 [OK]
docker.io docker.io/openshift/wildfly-81-centos7 A Centos7 based WildFly v8.1 image for use... 1
docker.io docker.io/pivotaldata/centos-gcc-toolchain CentOS with a toolchain, but unaffiliated ... 1
docker.io docker.io/smartentry/centos centos with smartentry 0 [OK]

2、拉取一个基本的空白centos镜像

[root@localhost ~]# docker pull centos
Error response from daemon: Get https://index.docker.io/v1/search?q=centos&n=25: dial tcp 52.54.178.62:443: i/o timeout

3、将docker仓库源地址改为中国区官方地址,修改/etc/docker/daemon.json

[root@localhost docker]#vim /etc/docker/daemon.json
{
"registry-mirrors":["https://wntgy2z8.mirror.aliyuncs.com"]
}

4、重新加载daemon

[root@localhost ~]# systemctl daemon-reload

5、重启docker服务

[root@localhost ~]#service docker restart

6、拉取centos镜像,成功

[root@localhost docker]# docker pull docker.io/centos
Using default tag: latest
Trying to pull repository docker.io/library/centos ...
latest: Pulling from docker.io/library/centos
8ba884070f61: Downloading 4.799 MB/75.4 MB
8ba884070f61: Downloading 5.34 MB/75.4 MB
8ba884070f61: Downloading 17.73 MB/75.4 MB
8ba884070f61: Downloading [=============> ] 20.41 MB/75.4 MB
8ba884070f61: Downloading [===============> ] 23.62 MB/75.4 MB