【发布时间】:2023-03-13 00:31:01
【问题描述】:
我正在尝试在 docker 中提取图像,但出现以下错误:
root@ubuntu:~# docker pull hello-world
提取存储库 hello-world
FATA[0003] 获取 https://index.docker.io/v1/repositories/library/hello-world/images: x509: 无法加载系统根目录并且没有提供根目录
【问题讨论】:
我正在尝试在 docker 中提取图像,但出现以下错误:
root@ubuntu:~# docker pull hello-world
提取存储库 hello-world
FATA[0003] 获取 https://index.docker.io/v1/repositories/library/hello-world/images: x509: 无法加载系统根目录并且没有提供根目录
【问题讨论】:
确保您的系统时间设置正确。当我的虚拟机时间与现实世界不同步时,我看到了这个错误。
试试
sudo ntpdate time.nist.gov
【讨论】:
你需要更新 repos,移除 lxc-docker 并安装 docker-engine
添加新的 gpg 密钥
$ apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
编辑您的 /etc/apt/sources.list.d/docker.list
$ vim /etc/apt/sources.list.d/docker.list
#remove the contents and replace with the following depending on your os and version:
deb https://apt.dockerproject.org/repo debian-wheezy main
deb https://apt.dockerproject.org/repo debian-jessie main
deb https://apt.dockerproject.org/repo debian-stretch main
deb https://apt.dockerproject.org/repo ubuntu-precise main
deb https://apt.dockerproject.org/repo ubuntu-trusty main
deb https://apt.dockerproject.org/repo ubuntu-utopic main
deb https://apt.dockerproject.org/repo ubuntu-vivid main
deb https://apt.dockerproject.org/repo ubuntu-wily main
更新源文件后,运行以下命令:
$ apt-get update
删除旧的
$ apt-get purge lxc-docker*
安装新的
$ apt-get install docker-engine
【讨论】:
我解决这个问题是通过运行两个命令
这是sudo apt-get install --reinstall ca-certificates ca-certificates-java
sudo service docker restart
现在拉任何东西
【讨论】:
两种修复方法。
1) 你可以登录 docker: docker login (console command) - 10% 可以帮助
2) docker 在 ubuntu 上安装有问题。
您需要编辑文件 /etc/resolv.conf
2.1) 在此文件中添加下两行
nameserver 8.8.8.8
nameserver 8.8.4.4
2.2) 并重启 docker
sudo service docker restart
【讨论】: