- 官方安装文档
https://docs.docker.com/engine/install/centos/
- 如果下载忙更换阿里的源
yum install -y yum-utils
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install docker-ce
sudo systemctl start docker
- docker源地址切换到阿里云
vi /etc/docker/daemon.json
{
"registry-mirrors": ["https://ae2nhzyb.mirror.aliyuncs.com"]
}
##然后重启Docker服务
sudo systemctl daemon-reload
sudo systemctl restart docker
- 安装docker-compose
curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.0/docker-compose-`uname -s`-`uname -m` > /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose -version
网友评论