Error : unable to communicate with Docker | Error checking and/or regenerating the certs
G3z opened this issue · 1 comments
G3z commented
i'm using nanobox with docker in the lightweight VM
$ nanobox start
Starting Nanobox :
--------------------------------------------------------------------------------
+ HEADS UP:
+ Nanobox will run a single VM transparently within VirtualBox.
+ All apps and containers will be launched within the same VM.
--------------------------------------------------------------------------------
! Launching VM
Running pre-create checks...
(nanobox) Boot2Docker URL was explicitly set to "https://d1ormdui8qdvue.cloudfront.net/boot2docker/v1/boot2docker.iso" at create time, so Docker Machine cannot upgrade this machine to the latest version.
Creating machine...
(nanobox) Boot2Docker URL was explicitly set to "https://d1ormdui8qdvue.cloudfront.net/boot2docker/v1/boot2docker.iso" at create time, so Docker Machine cannot upgrade this machine to the latest version.
(nanobox) Downloading /Users/g3z/.docker/machine/cache/boot2docker.iso from https://d1ormdui8qdvue.cloudfront.net/boot2docker/v1/boot2docker.iso...
(nanobox) 0%....10%....20%....30%....40%....50%....60%....70%....80%....90%....100%
(nanobox) Creating VirtualBox VM...
(nanobox) Creating SSH key...
(nanobox) Starting the VM...
(nanobox) Check network to re-create if needed...
(nanobox) Waiting for an IP...
Waiting for machine to be running, this may take a few minutes...
Detecting operating system of created instance...
Waiting for SSH to be available...
Detecting the provisioner...
Provisioning with boot2docker...
Copying certs to the local machine directory...
Copying certs to the remote machine...
Setting Docker configuration on the remote daemon...
Checking connection to Docker...
Error creating machine: Error checking the host: Error checking and/or regenerating the certs: There was an error validating certificates for host "192.168.99.101:2376": x509: certificate has expired or is not yet valid
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.
✓ Configuring Network
✓ Loading kernel modules
✓ Cleaning DHCP
✓ Regenerating Docker certs
✓ Joining virtual network
Error : unable to communicate with Docker
Context : failed to initialize docker for provider
than on any subsequent start:
$ nanobox start
✓ Skipping (already running)
Error : unable to communicate with Docker
Context : failed to initialize docker for provider
by using docker-machine I saw this
$docker-machine ls
NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
nanobox - 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 has expired or is not yet valid
SOLUTION
$ docker-machine regenerate-certs -f --client-certs nanobox
$ docker-machine stop nanobox
$ nanobox run
adambouchard commented
Thanks for posting this @G3z . I ran into the same issue and this solution solved it.