博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Docker: Unknown – Unable to query docker version: x509: certificate is valid for
阅读量:6826 次
发布时间:2019-06-26

本文共 2141 字,大约阅读时间需要 7 分钟。

 

I was playing around with Docker locally and somehow ended up with this error when I tried to list my :

$ docker-machine ls

NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS

default - virtualbox Running tcp://192.168.99.101:2376 Unknown Unable to query docker version: Get https://192.168.99.101:2376/v1.15/version: x509: certificate is valid for 192.168.99.100, not 192.168.99.101

My Google Fu was weak I couldn't find any suggestions for what this might mean so I tried shutting it down and starting it again!

On the restart I actually got some helpful advice:

$ docker-machine stop

Stopping "default"...

Machine "default" was stopped.

$ docker-machine start

Starting "default"...

(default) Check network to re-create if needed...

(default) Waiting for an IP...

Machine "default" was started.

Waiting for SSH to be available...

Detecting the provisioner...

Started machines may have new IP addresses. You may need to re-run the `docker-machine env` command.

$ docker-machine env

Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.101:2376": x509: certificate is valid for 192.168.99.100, not 192.168.99.101

You can attempt to regenerate them using 'docker-machine regenerate-certs [name]'.

Be advised that this will trigger a Docker daemon restart which will stop running containers.

 

 

 

So I tried that:

And then regenerates my certificates:

$ docker-machine regenerate-certs

Regenerate TLS machine certs? Warning: this is irreversible. (y/n): y

Regenerating TLS certificates

Waiting for SSH to be available...

Detecting the provisioner...

Copying certs to the local machine directory...

Copying certs to the remote machine...

Setting Docker configuration on the remote daemon...

And now everything is happy again!

$ docker-machine ls

NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS

default - virtualbox Running tcp://192.168.99.101:2376 v1.9.0

Be Sociable, Share!

 

来自:

 

说明:

  1. 如果有多台虚机的时候,需要在命令的后面加机器名。
  2. 直接运行docker-machine env或者regenerate-certs可能不行,会报连接不上的错误,那么就从头执行:stop->start->env->regenerate-certs.

转载于:https://www.cnblogs.com/time-is-life/p/7722267.html

你可能感兴趣的文章
反射(6)程序集加载上下文
查看>>
oracle触发器after update of |更改之后赋值|
查看>>
Oracle命令:授权-收回权限-角色-用户状态
查看>>
常用的Ubuntu APT命令参数
查看>>
成功加盟者的8个特点
查看>>
Java基础03 构造器与方法重载
查看>>
如何让你的服务屏蔽Shodan扫描
查看>>
SpringBoot+Elasticsearch
查看>>
Vim 操作符命令和动作命令
查看>>
动态代理
查看>>
C语言 格式化输出--%m.n
查看>>
gradle配置国内的镜像
查看>>
Gitlab安装与备份恢复
查看>>
Elasticsearch-sql 用SQL查询Elasticsearch
查看>>
(原創) 如何讓Nios II自動抓到自己寫的IP的HAL? (SOC) (Nios II) (SOPC Builder) (DE2-70)
查看>>
JFS技术详细介绍
查看>>
Linux VI command
查看>>
创建可重用的对象
查看>>
jquery easyui treegrid使用小结:二
查看>>
QTP当前只打开一个浏览器,CreationTime失效的问题
查看>>