1、要先安装docker-ce-selinux-17.03.2.ce,否则安装docker-ce会报错(仅阿里云安装docker前提)
yum install https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-selinux-17.03.2.ce-1.el7.centos.noarch.rpm
2、安装依赖
$ sudo yum install -y yum-utils \
device-mapper-persistent-data \
lvm2
3、设置docker源
$sudo yum-config-manager \
--add-repo \
https://download.docker.com/linux/centos/docker-ce.repo
4、启动edge版 docker.repo源
$sudo yum-config-manager --enable docker-ce-edge
5、安装docker-ce版
$sudo yum install docker-ce-17.03.2.ce
6、启动docker
$sudo systemctl start docker
7、设置自动启动
$systemctl enable docker
8、镜像加速配置:
$sudo mkdir -p /etc/docker
$sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://088aunhx.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
9、验证:执行hello-world
$docker run hello-world