Docker 的安装
Docker 支持以下的CentOS版本:
CentOS 7 (64-bit)
CentOS 6.5 (64-bit) 或更高的版本
前提条件
目前 CentOS 仅发行版本中的内核支持Docker
Docker 运行在CentOS 7上,要求系统为64位、系统内核版本为 3.10 以上
Docker 运行在CentOS-6.5 或更高的版本的CentOS 上,要求系统为64位、系统内核版本为2.6.32-431 或者更高版本
使用yum 安装(CentOS 7下)
Docker 要求 CentOS 系统的内核版本高于3.10,查看本页面的前提条件来验证你的CentOS版本是否支持Docker
[root@localhost ~]# uname -r
3.10.0-693.el7.x86_64
配置安装yum 源
https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
[root@localhost yum.repos.d]# yum install -y epel-release
[root@localhost yum.repos.d]# ls
CentOS-Base.repo docker-ce.repo epel.repo epel-testing.repo
安装依赖包
[root@localhost ~]# yum install -y lvm2-2.02.180-10.el7_6.3.x86_64
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* epel: mirror.xeonbd.com
Resolving Dependencies
--> Running transaction check
---> Package lvm2.x86_64 7:2.02.180-10.el7_6.3 will be installed
--> Finished Dependency Resolution
安装docker-ce (社区免费版)
[root@localhost yum.repos.d]# yum install docker-ce
启动docker 服务
[root@localhost ~]# systemctl start docker
docker 默认需要去访问DockerHub 拉去镜像