这边需要在vm中使用docker,记录下
1.更新系统包列表
确保您的系统包列表是最新的
bash
sudo apt update
2.安装依赖工具
bash
sudo apt install apt-transport-https ca-certificates curl software-properties-common
3.添加Docker GPG密钥
bash
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
4.设置Docker存储库
bash
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
5.再次更新系统包列表
bash
sudo apt update
6.安装Docker Engine
bash
sudo apt install docker-ce docker-ce-cli containerd.io
7.验证安装
bash
sudo docker --version
如果看到版本出现,就代表安装成功了