Docker: Unknown – Unable to query docker version: x509: certificate is valid for
2017-10-24 10:26
1201 查看
I was playing around with Docker locally and somehow ended up with this error when I tried to list my docker machines:
$ 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 |
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... |
$ docker-machine ls NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS default - virtualbox Running tcp://192.168.99.101:2376 v1.9.0 |
来自:http://www.markhneedham.com/blog/2016/12/21/docker-unknown-unable-to-query-docker-version-x509-certificate-is-valid-for/
说明:
如果有多台虚机的时候,需要在命令的后面加机器名。
直接运行docker-machine env或者regenerate-certs可能不行,会报连接不上的错误,那么就从头执行:stop->start->env->regenerate-certs.
相关文章推荐
- docker 报错:x509: certificate has expired or is not yet valid
- docker 报错:x509: certificate has expired or is not yet valid
- docker 报错:x509: certificate has expired or is not yet valid
- docker 报错:x509: certificate has expired or is not yet valid
- bug--Unable to add window –token is not valid; is your activity running?
- canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
- 关于Failed to execute 'querySelectorAll' on 'Document': '#1517905886124' is not a valid selector."
- Android Unable to add window -- token android.os.BinderProxy@3a067204 is not valid错误分析记录
- Unable to add window -- token null is not for an application
- docker 解决 x509: certificate signed by unknown authority
- - Unable to add window -- token null is not valid; is your activity running?
- iOS9.0 canOpenURL: failed for URL: "xx" - error:"This app is not allowed to query for scheme xx"
- Unable to add window -- token null is not valid; is your activity running?
- iOS分享授权问题:-canOpenURL: failed ..."This app is not allowed to query for sscheme xx
- Unable to add window -- token null is not for an application
- android.view.WindowManager$BadTokenException: Unable to add window -- token null is not for an appli
- Unable to start debugging on the web server. The IIS worker process for the launched URL is not currently running
- ios 9.1之后 微信第三方登陆“This app is not allowed to query for scheme weixin”问题
- 关于 Unable to add window -- token null is not for an application 错误的解决方法
- Unable to query for default vendor from RPM: Error while executing process. Cannot run program "rpm"