方式一:
yum install -y yum-utils device-mapper-persistent-data lvm2
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
yum install -y docker-ce
方式二:
curl -fsSL https://get.docker.com/ | sh
systemctl start docker && systemctl enable docker
#镜像加速
vim /etc/docker/daemon.json
{
"registry-mirrors": [
"https://xxx.mirror.aliyuncs.com",
"https://hub-mirror.c.163.com",
"https://mirror.baidubce.com",
"https://ccr.ccs.tencentyun.com"
]
}
wget https://github.com/docker/compose/releases/download/v2.17.2/docker-compose-`uname -s`-`uname -m` -O /usr/local/bin/docker-compose &&
chmod +x /usr/local/bin/docker-compose