安装Docker
# 添加k8sdocker的阿里云YUM源
wget https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo -O /etc/yum.repos.d/docker-ce.repo
# 安装docker-ce
yum install docker-ce-19.03.13 -y
# 运行和开机启动docker
systemctl start docker.service
systemctl enable docker.service
配置加速器
# 参考:https://cr.console.aliyun.com/
cat >> /etc/docker/daemon.json << EOF
{
"registry-mirrors": ["https://gg3gwnry.mirror.aliyuncs.com"]
}
EOF
安装Docker-Compose
git地址:https://docs.docker.com/compose/compose-file/compose-file-v3/
安装地址:https://docs.docker.com/compose/install/other/
安装命令
# 下载docker-compose
curl -SL https://github.com/docker/compose/releases/download/v2.16.0/docker-compose-linux-x86_64 -o /usr/local/bin/docker-compose
# 创建软链接
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
# 检查
docker-compose version