安装添加使用 HTTPS 传输的软件包
sudo apt-get -y install apt-transport-https ca-certificates curl software-properties-common
卸载后重装
dpkg -l | grep docker
添加软件源的GPG密钥 (下面的是阿里源)
curl -fsSL http://mirrors.aliyun.com/docker-ce/linux/ubuntu/gpg | sudo apt-key add -
添加软件源(阿里源)
sudo add-apt-repository "deb [arch=amd64] http://mirrors.aliyun.com/docker-ce/linux/ubuntu $(lsb_release -cs) stable"
更新apt-get
sudo apt-get update
安装
sudo apt-get install docker-ce
启动 , 你可能要用systemctl命令~
service docker start
搞定!!!
防止镜像源链接不上,添加多几个镜像源地址
sudo vi /etc/docker/daemon.json
写入文件
{
"registry-mirrors": [
"https://docker.m.daocloud.io",
"https://hub-mirror.c.163.com",
"https://docker.mirrors.ustc.edu.cn",
"https://registry.docker-cn.com"
]
}