ubuntu使用国内源安装docker

  1. 安装软件包
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common

2.添加软件源的GPG密钥(我用的中科大)
中科大

curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

阿里源

curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -

3.向 source.list 中添加Docker软件源
中科大

sudo add-apt-repository "deb [arch=amd64] https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

阿里源

sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"

4.更新& 安装

sudo apt-get update
sudo apt-get install docker-ce
也可以指定版本安装
sudo apt-get install docker-ce=<VERSION>
posted @ 2022-04-27 10:20  tccxy  阅读(885)  评论(0编辑  收藏  举报