参考连接
https://help.aliyun.com/zh/ecs/use-cases/install-and-use-docker-on-a-linux-ecs-instance#33f11a5f1800n
更换源为阿里源
先看可能遇到的问题
我用的ubuntu版本为20版本的、如果你用的其他版本,请看参考连接 然后参考我的命令将mirrors.cloud.aliyuncs.com修改为mirrors.aliyun.com。
sudo apt update
sudo apt-get -y install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
echo
“deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] http://mirrors.aliyun.com/docker-ce/linux/ubuntu
KaTeX parse error: Expected 'EOF', got '&' at position 20: …etc/os-release &̲& echo "VERSION_CODENAME”) stable" |
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
!](https://i-blog.csdnimg.cn/direct/638f171cdf7445249e256ff9f77f7866.png)
sudo apt update
sudo apt-get install -y docker-ce docker-ce-cli containerd.io