当docker拉图像时出现x509错误

时间:2017-09-04 13:19:21

标签: docker ip x509certificate pull

我创建了一个新VM并安装了docker.But它无法提取任何图像。 我的VM是Centos7。

就像这样:

Error while pulling image: Get https://index.docker.io/v1/repositories/library/hello-world/images: x509: certificate is valid for 192.168.0.81, not index.docker.io

这是我的错误报告,

    Containers: 0
 Running: 0
 Paused: 0
 Stopped: 0
Images: 0
Server Version: 1.12.6
Storage Driver: devicemapper
 Pool Name: docker-253:0-1552802-pool
 Pool Blocksize: 65.54 kB
 Base Device Size: 10.74 GB
 Backing Filesystem: xfs
 Data file: /dev/loop0
 Metadata file: /dev/loop1
 Data Space Used: 11.8 MB
 Data Space Total: 107.4 GB
 Data Space Available: 16.63 GB
 Metadata Space Used: 581.6 kB
 Metadata Space Total: 2.147 GB
 Metadata Space Available: 2.147 GB
 Thin Pool Minimum Free Space: 10.74 GB
 Udev Sync Supported: true
 Deferred Removal Enabled: false
 Deferred Deletion Enabled: false
 Deferred Deleted Device Count: 0
 Data loop file: /var/lib/docker/devicemapper/devicemapper/data
 WARNING: Usage of loopback devices is strongly discouraged for production use. Use `--storage-opt dm.thinpooldev` to specify a custom block storage device.
 Metadata loop file: /var/lib/docker/devicemapper/devicemapper/metadata
 Library Version: 1.02.135-RHEL7 (2016-11-16)
Logging Driver: journald
Cgroup Driver: systemd
Plugins:
 Volume: local
 Network: host bridge null overlay
Swarm: inactive
Runtimes: docker-runc runc
Default Runtime: docker-runc
Security Options: seccomp selinux
Kernel Version: 3.10.0-514.26.2.el7.x86_64
Operating System: CentOS Linux 7 (Core)
OSType: linux
Architecture: x86_64
Number of Docker Hooks: 2
CPUs: 2
Total Memory: 976.5 MiB
Name: localhost.localdomain
ID: ZTET:FNUT:QHKE:TQOP:6XUI:NUWC:GH3D:ZPFM:5CYO:XMYE:BFMV:RQL3
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
WARNING: IPv4 forwarding is disabled
WARNING: bridge-nf-call-iptables is disabled
WARNING: bridge-nf-call-ip6tables is disabled
Insecure Registries:
 127.0.0.0/8
Registries: docker.io (secure)

我不知道“192.168.0.81”是什么,每个pull命令都有相同的报告。

请帮帮我,谢谢。

这是我的码头信息:

index.scss

2 个答案:

答案 0 :(得分:0)

如果您位于代理服务器后面,请确保将docker配置为使用此代理服务器。 https://docs.docker.com/engine/admin/systemd/#httphttps-proxy

答案 1 :(得分:0)

如果Windows(Docker Desktop),则在docker注册表中添加不安全的主机,然后导航至“设置”->“ Docker引擎”->添加以下条目,其中host.com是您要拉取的主机。

{
  "registry-mirrors": [],
  "insecure-registries": 
   ["host.com"],
  "debug": true,
  "experimental": false
}

enter image description here