要在Ubuntu上安装Docker,可以按照以下步骤进行:
1. 确认你的计算机是aarch64架构,可以使用命令 `uname -m` 检查。
2. 安装Docker依赖项
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
3. 添加Docker GPG密钥:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
4. 添加Docker源:
echo "deb [arch=arm64 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. 更新软件包库并安装Docker:
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
6. 验证Docker是否正确安装:
sudo docker run hello-world
如果一切正常,你应该能够看到Hello World容器成功运行。