安装docker
1)、安装docker依赖
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
2)、设置镜像仓库
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
3)、安装docker
sudo yum install docker-ce docker-ce-cli containerd.io
4)、启动docker
sudo systemctl start docker
#查看docker版本
docker --version
5)、设置开机启动
sudo systemctl enable docker
6)、阿里云镜像加速
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://5y3reglm.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
安装docker-compose
1)、安装docker-compose
sudo curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.1/docker-compose-`un