Stuck with a docker error certificate signed by unknown authority? We can help you fix it.
Here at Bobcares, we have seen several causes for this error while troubleshooting Docker issues as part of our Docker Hosting Support for Docker users, web hosts, and online service providers.
Today we’ll take a look at the cause for this error and how to fix it.
What causes the docker error certificate signed by an unknown authority to occur
Now let’s see the root cause for this error to occur.
If there is no trusted certificate enabled such as the default self-signed certificate generated by DTR then this error occurs.
Or if cert was not provided during installation then it leads to this error message.
How we tackle the docker error certificate signed by unknown authority
A customer was trying to pull a docker image from a docker registry which leads to this error message.
Now let’s see how our Support Engineers tackle this error.
Here first, we need to restart the docker so that it detects the change in OS certificates.
Docker has an additional location that we can use to trust individual registry server CA.
We place the CA cert inside /etc/docker/certs.d/<docker registry>/ca.crt. Also, we include the port number if we want to specify that in the image tag, e.g.
/etc/docker/certs.d/my-registry.example.com:5000/ca.crt
Another solution to this error is
We create a file /etc/docker/daemon.json and add insecure-registries
{
"insecure-registries" : ["docker.domain.com:443"]
}
We restart docker daemon by running the command
systemctl restart docker
Then we create a directory with the same name as the host.
mkdir -p /etc/docker/certs.d/docker.domain.com
Finally, get the certificate and save it to the created directory.
ex +’/BEGIN CERTIFICATE/,/END CERTIFICATE/p’ <(echo | openssl s_client -showcerts -connect docker.domain.com:443) -scq > /etc/docker/certs.d/docker.domain.com/docker_registry.crt
This must fix the error.
[Need any further assistance in fixing Docker errors? – We’re available 24*7]
Conclusion
In short, this Docker error occurs if there is no trusted certificate enabled. Today, we saw the resolution to this error.
0 Comments