Docker certificate signed error

$ docker ps

error during connect: Get https://192.168.99.100:2376/v1.37/containers/json: x509: certificate signed by unknown authority

Above error appears a lot in docker if any changes made in the settings. Or sometimes if system is restarted.

How to resolve this error?

I executed below steps to solve this error:

Go to your docker toolbox folder and run the below command.

@S500719W10N MINGW64 /c/Program Files/Docker Toolbox

$ docker-machine regenerate-certs default

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

Regenerating TLS certificates

Regenerating local certificates

…..

After running the above command problem should be resolved. In case if problem still not resolved, then follow the below steps:

Use SSH to login to virtual machine:

$ docker-machine ssh default
docker@default:~$ sudo vi /var/lib/boot2docker/profile
Add a NO_PROXY setting
# replace with your oproxy environment settings
export “HTTP_PROXY=http://PROXY:PORT”
export “HTTPS_PROXY=http://PROXY:PORT”
# you can add more no_proxy with your environment.
export “NO_PROXY=192.168.99.,.local,169.254/16,.example.com,192.168.59.

Restart docker
docker@default:~$ sudo /etc/init.d/docker restart
docker@default:~$ exit

$ docker-machine regenerate-certs default

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 restart default

Restarting “default”…

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

(default) Windows might ask for the permission to configure a dhcp server. Sometimes, such confirmation window is minimized in the taskbar.

(default) Waiting for an IP…

Waiting for SSH to be available…

Detecting the provisioner…

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

$ eval $(docker-machine env default)

$ docker-machine ls

NAME      ACTIVE   DRIVER       STATE     URL                         SWARM   DOCKER     ERRORS

default   *        virtualbox   Running   tcp://192.168.99.101:2376           v18.09.6

Problem solved !!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s