ubuntu 系统 使用docker
如果过去安装过 docker ,先删除:
sudo apt-get remove docker docker-engine docker.io
1、安装依赖:
sudo apt-get install apt-transport-https ca-certificates curl gnupg2 software-properties-common
2、根据你的发行版,添加 信任docker的GPG公钥:
(Debian版本):
curl -fsSL https://download.docker.com/linux/debian/gpg | sudo apt-key add -
(Ubuntu版本):
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
3、对于 amd64 架构的计算机,添加软件仓库:
sudo add-apt-repository "deb [arch=amd64] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debi $(lsb_release -cs) stable"
如果你是树莓派或其它ARM架构计算机,请运行:
echo "deb [arch=armhf] https://mirrors.tuna.tsinghua.edu.cn/docker-ce/linux/debian \
$(lsb_release -cs) stable" | \
sudo tee /etc/apt/sources.list.d/docker.list
4、最后进行安装:
sudo apt-get update
sudo apt-get install docker-ce
(参考网站 :https://mirror.tuna.tsinghua.edu.cn/help/docker-ce/)【清华大学开源软件镜像站】