docker 安装 Failed to restart docker.service: Unit not found 镜像加速
解决方案###
- 以前的安装残留 重新安装
find / -name "docker*"
- centos8
- 添加软件源信息
yum-config-manager --add-repo http://mirrors.aliyun.com/docker-ce/linux/centos/docker-ce.repo
curl https://download.docker.com/linux/centos/docker-ce.repo -o /etc/yum.repos.d/docker-ce.repo
- 选择安装版本
yum list docker-ce.x86_64 --showduplicates | sort -r
- 发生错误 安装container.io 依赖
yum -y install https://download.docker.com/linux/fedora/30/x86_64/stable/Packages/containerd.io-1.2.6-3.3.fc30.x86_64.rpm
- 继续安装
yum install docker-ce
安装docker的加速镜像###
sudo mkdir -p /etc/docker
sudo tee /etc/docker/daemon.json <<-'EOF'
{
"registry-mirrors": ["https://阿里云",
"http://registry.docker-cn.com",
"http://docker.mirrors.ustc.edu.cn",
"http://hub-mirror.c.163.com"]
}
EOF
sudo systemctl daemon-reload
sudo systemctl restart docker
centos8 /etc/docker/ 下如果没有daemon.json文件 touch一个
malu