下载docker
shell
# 1.阿里云镜像资源(先执行这个下载加速)
yum-config-manager --add-rep https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
#2.安装docker
yum install -y docker-ce
启动Docker服务
shell
service docker start
chkconfig docker on
设置国内镜像
shell
vi /etc/docker/daemon.json
#添加后
{
"registry-mirrors": ["https://mirror.ccs.tencentyun.com"],
"live-restore": true
}
重新启动 Docker 服务。
shell
systemctl daemon-reload
service docker restart
Docker Compose的安装
shell
curl -L https://github.com/docker/compose/releases/download/1.28.6/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
测试是否安装成功:
shell
docker-compose --version
1