Error checking TLS connection: Error checking and/

2019-01-14 02:17发布

After I restarted my windows i cannot connect to docker machine running in Oracle Virtual Box. When i start Docker QuickStart Terminal every thing looks fine, it's coming up OK and it gives me this message:

docker is configured to use the default machine with IP 192.168.99.100
For help getting started, check out the docs at https://docs.docker.com

but when i do:

$ docker-machine ls
NAME      ACTIVE   DRIVER       STATE     URL   SWARM   DOCKER   ERRORS
default   -        virtualbox   Timeout

and:

λ docker images
An error occurred trying to connect: Get http://localhost:2375/v1.21/images/json: dial tcp 127.0.0.1:2375: ConnectEx tcp: No connection could be made because the target machine actively refused it.

also when i try to reinitialize my env., i get:

λ docker-machine env default
Error checking TLS connection: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.100:2376": dial tcp 192.168.99.100:2376: i/o timeout
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.

BTW, Regenerating certs also not helping. Any idea?

Thanks.

8条回答
再贱就再见
2楼-- · 2019-01-14 02:39

Here is what worked for me. The first steps are similar to what Hazhir proposed, then followed by regenerate the certificates.

  1. Open Network And Sharing Center.
  2. Click on Change Adapter Setting.
  3. Disable all active VMWare network adapters. Usually has explanation "VirtualBox Host-Only Ethernet Adapter".
  4. Connect to your container by running docker-machine start.
  5. Run docker-machine env. If you're like me then you'd get following error:

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

Which is good. Now all we need to do is to run

docker-machine regenerate-certs -f default

Then test it again with docker-machine env. If you get:

SET DOCKER_TLS_VERIFY=1
SET DOCKER_HOST=tcp://192.168.99.100:2376
SET DOCKER_CERT_PATH=C:\Users\Jay\.docker\machine\machines\default
SET DOCKER_MACHINE_NAME=default
REM Run this command to configure your shell:
REM     FOR /f "tokens=*" %i IN ('docker-machine env') DO %i

Then you're all set. In my case I needed to start my virtual machine by running Docker Quickstart Terminal.

查看更多
一纸荒年 Trace。
3楼-- · 2019-01-14 02:46

This worked for me:

  • Removed all host only interfaces from my virtualbox (VirtualBox => Preferences => Network => Host-only networks).
  • rmdir.exe --ignore-fail-on-non-empty ~/.docker/
  • docker-machine start
  • docker-machine env
  • eval $("C:\Program Files\Docker Toolbox\docker-machine.exe" env default) (added also at the end of my .bash_profile.
  • docker run hello-world <-- now rorking

Inspired in a post here.

查看更多
登录 后发表回答