CentOS 7 安装 Docker 并修改Docker下载镜像

一、安装要求:

Docker 运行在 CentOS 7 上,要求系统为64位、系统内核版本为 3.10 以上。通过 uname -r 命令查看你当前的内核版本:

CentOS 7 安装 Docker 并修改Docker下载镜像

二、CentOS 7 下使用yum安装docker:

Docker 软件包和依赖包已经包含在默认的 CentOS-Extras 软件源里,安装命令如下: 

[[email protected]_0_17_centos ~]# yum -y install docker-io

CentOS 7 安装 Docker 并修改Docker下载镜像

三、启动 Docker 后台服务:

CentOS 7 安装 Docker 并修改Docker下载镜像

四、测试运行 hello-world:

由于本地没有hello-world这个镜像,所以会下载一个hello-world的镜像,并在容器内运行。

[[email protected]_0_17_centos ~]# docker run hello-world

CentOS 7 安装 Docker 并修改Docker下载镜像


五、镜像加速

鉴于国内网络问题,后续拉取 Docker 镜像十分缓慢,我们可以需要配置加速器来解决,我使用的是阿里云的镜像地址(配置阿里云镜像可参考官方文档):

CentOS 7 安装 Docker 并修改Docker下载镜像

另外还有几款加速器下载速度也是不错的,如网易的163 docker镜像、ustc镜像等等.


参考资料:

http://www.runoob.com/docker/centos-docker-install.html