#在普通用户状态下安装docker
curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun
#将用户添加到docker组
sudo usermod -aG docker $USER
#更新用户组
newgrp docker
#安装docker-compose
sudo curl -L "https://ghproxy.com/https://github.com/docker/compose/releases/download/v2.2.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
#增加运行权限
sudo chmod +x /usr/local/bin/docker-compose
#测试是否安装成功,有输出内容即可
docker-compose
#给docker换源 编辑 /etc/docker/daemon.json 写入以下内容保存
{
"registry-mirrors": ["https://punulfd2.mirror.aliyuncs.com"]
}
#重启docker
sudo systemctl restart docker