安裝docker
1皮璧、安裝依賴包
sudo yum install -y yum-utils device-mapper-persistent-data lvm2
2棚愤、設(shè)置阿里云鏡像源
sudo yum-config-manager --add-repo https://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
3收夸、安裝 Docker-CE
sudo yum -y install docker-ce
啟動docker
# 開機自啟
sudo systemctl enable docker
# 啟動docker服務(wù)
sudo systemctl start docker
安裝docker-compose
# 下載docker compose
sudo curl -L "https://github.com/docker/compose/releases/download/v2.22.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
# 添加可執(zhí)行權(quán)限
sudo chmod +x /usr/local/bin/docker-compose
# 將文件copy到 /usr/bin/目錄下
sudo ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
# 查看版本
docker-compose --version