(使用中科大镜像源,同时支持PC与ARM设备)
1.添加源文件/etc/apt/sources.list.d/ustc.list
(也可以直接修改原来的/etc/apt/sources.list)
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-proposed main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe
#deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe
#deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe
#deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-proposed main multiverse restricted universe
#deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe
#deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe
2.安装必要工具
sudo apt-get update\
sudo apt-get -y install \
apt-transport-https \
ca-certificates \
curl \
software-properties-common
3.添加软件源的 GPG 密钥
curl -fsSL https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
4.向 source.list 中添加 Docker 软件源
sudo add-apt-repository \
"deb https://mirrors.ustc.edu.cn/docker-ce/linux/ubuntu \
$(lsb_release -cs) \
stable"
5.更新缓存并安装docker
sudo apt-get update
sudo apt-get -y install docker-ce
6.创建用户组并添加当前用户
sudo groupadd docker
sudo usermod -aG docker $USER
网友评论