docker安装
1.卸载旧版
卸载旧版
yum remove docker \
docker-client \
docker-client-latest \
docker-common \
docker-latest \
docker-latest-logrotate \
docker-logrotate \
docker-engine
2.安装一个yum工具
yum install -y yum-utils
3.配置docker的yum源
yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
4.安装docker
yum install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
5.启动docker
# 启动Docker
systemctl start docker# 停止Docker
systemctl stop docker# 重启
systemctl restart docker# 设置开机自启
systemctl enable docker
6.配置镜像加速
tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://xxxx.mirror.aliyuncs.com"]
}
EOF
上面从网址从阿里云镜像加速器找
# 重新加载配置
systemctl daemon-reload# 重启Docker
systemctl restart docke
docker-compose安装
参考文章:docker-compose -v 显示【/usr/local/bin/docker-compose:行1: html: 没有那个文件或目录】错误问题_SexyK的博客-CSDN博客