尝试 运行 基本 ubuntu 图像时出现关键错误

Key error trying to run basic ubuntu image

我正在尝试 运行 基本图像,如 Docker 教程中所述:-

docker --version
Docker version 1.9.0, build 76d6bc9

docker run -t -i ubuntu:14.04 /bin/bash

但它正在报告:

Error while pulling image: Get https://index.docker.io/v1/repositories/library/ubuntu/images: x509: certificate is valid for FG3K6C3A15800002, not index.docker.io

我在公司防火墙后面,所以适当地设置了 http_proxy 和 https_proxy env 变量。服务器本身是 Ubuntu 14.04 LTS。

我已经阅读了各种关于时钟设置等的帖子,但这些看起来还不错。

有人有什么想法吗?

即使您声明已设置代理变量,请确保在您的 /etc/default/docker:

中尝试此 完整 代理变量集
export "HTTP_PROXY=http://<user>:<password>@<proxy.company.com>:<port>"
export "HTTPS_PROXY=http://<user>:<password>@<proxy.company.com>:<port>"
export "http_proxy=http://<user>:<password>@<proxy.company.com>:<port>"
export "https_proxy=http://<user>:<password>@<proxy.company.com>:<port>"
export "NO_PROXY=.company.com,.sock,localhost,127.0.0.1,::1"
export "no_proxy=.company.com,.sock,localhost,127.0.0.1,::1"

如果这不能解决问题,请将 docker 升级到最新的 1.10.1。

注意:docker machine issue 531 提到 docker-machine provision 作为解决方法。


更新2021 on issue 531

I had the same exact issue just now and apparently it was fixed by resetting docker to factory settings and enabling the Kubernetes cluster again.

EDIT: I managed to reproduce the fix on a second machine. The exact steps in my case were:

  • start Docker Desktop
  • update to 3.2.1 -> immediately after this another updated was available to 3.2.2
  • update to 3.2.2
  • enable Kubernetes cluster -> wait until the error appears
  • right click on Docker in the System Tray -> choose Troubleshoot
  • click Reset to factory defaults -> wait until the reset is finished
  • right click on Docker in the System Tray -> choose Quit Docker Desktop
  • open Docker Desktop again
  • select only Enable Kubernetes