1.卸载旧版本
sudo apt-get remove docker docker-engine docker.io containerd runc
2.通过存储库安装
2.1 更新apt软件包索引并安装软件包以允许apt通过HTTPS使用存储库
sudo apt-get update
2.2 添加Docker的官方GPG密钥
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
2.3 通过搜索指纹的后8个字符,验证您现在是否拥有带有指纹的密钥
sudo apt-key fingerprint 0EBFCD88
2.4 添加安装源
sudo add-apt-repository \
"deb [arch=amd64] https://download.docker.com/linux/ubuntu \
$(lsb_release -cs) \
stable"
3.安装DOCKER引擎
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
4.添加普通用户权限
sudo usermod -aG docker <your-user>
5. 安装Docker Compose
sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
6. 验证安装
docker-compose --version
评论