安装Docker
curl -fsSL https://get.docker.com -o get-docker.sh
chmod +x get-docker.sh
bash get-docker.sh --mirror Aliyun
systemctl enable docker && systemctl start docker
配置镜像加速
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://nvqx8ilz.mirror.aliyuncs.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
安装Docker Compose插件(使用以上脚本默认安装)
Ubuntu/Debian安装方法
sudo apt-get install docker-compose-plugin -y
CentOS安装方法
yum install docker-compose-plugin -y
使用方法
docker compose
独立安装Docker Compose插件
curl -L "https://github.com/docker/compose/releases/download/v2.9.0/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
chmod +x /usr/local/bin/docker-compose
使用方法
docker-compose