1、安装条件
CentOS 7 (64-bit) ,内核3.10及以上; CentOS 6,5 (64-bit),内核2.6.32-431及以上。2、CentOS6.8安装
```shell ##安装Docker依赖库 yum install -y epel-release ##执行Docker yum install -y docker-io ##安装后配置文件: /etc/sysconfig/docker ##启动Docker并确认版本 service docker start docker version ##运行hello-world镜像 docker run hello-world<h1>3、CentOS7.0安装</h1>
官网步骤:https://docs.docker.com/install/linux/docker-ce/centos/
<h1>4、使用Yum方式安装(CentOS7.0)</h1>
```shell
##执行系统更新
yum update
##配置Yum源
cat >/etc/yum.repos.d/docker.repo <<EOF
[dockerrepo]
name=Docker Repository
baseurl=http://yum.dockerproject.org/repo/main/centos/7
enable=1
gpgcheck=1
gpgkey=https://yum.dockerproject.org/gpg
EOF
##安装Docker
yum install docker
5、使用Script方式安装(CentOS7.0)
```shell ##执行系统更新 yum update ##执行安装脚本 curl -sSL https://get.docker.com/ | sh ##启动Docker systemctl start docker ##设置开机自启 systemctl enable docker ##运行hello-world镜像 docker run hello-world ```6、使用Rpm包安装(CentOS7.0)
下载目录:https://download.docker.com/linux/centos/7/x86_64/stable/Packages/
7、Docker镜像下载加速配置
登录网址:https://dev.aliyun.com/search.html
注册后得到加速ID,假设为:kfp63jaj
执行如下命令:
##copy配置文件(CentOS7.0配置文件:/etc/docker/deamon.json)
cp /lib/systemd/system/docker.server /etc/systemd/system/docker.server
##更改权限
chmod a+x /etc/systemd/system/docker.server
##修改文件
vi /etc/systemd/system/docker.server
##在ExecStart=/usr/bin/dockerd-current后添加如下内容
ExecStart=/usr/bin/dockerd-current --registry-mirror=https://kfp63jaj.mirror/aliyun.com
##重新加载配置文件并重启
systemctl daemon-reload
systemctl restart docker