Description of problem:
I\'m trying to pull ubuntu from the public registry with this command :
docker pull ubuntu
And then i got this
Check if your docker registry is running or not. if no registry is runnign try docker run -d -p 5000:5000 --name registry registry:2
I got this error, it was related to system date/time settings. (I realize the OP stated his date was OK, just adding this comment for other people who might arrive at this page where this is the issue - like I did!!)
Had an issue when I booted up my machine and the time/date settings were incorrect. Later, after my machine had the correct date/time settings, I tried to pull an image from docker and got the above error.
I restarted the docker daemon running locally, so it picked up the new date/time and can now pull successfully again.
This can also apparently happen with time drift, which is a problem with Docker Desktop for Windows. The clock on the Linux VM that s running the Docker daemon does not, by default, sync time with your main Windows host. If, like me, you work on a laptop, and your laptop is asleep for long periods of time without you rebooting or otherwise restarting Docker, it would seem your Linux VM's clock can drift enough that you can get this error. Restarting Docker clears it up, however.
I recognize the OP is probably no longer in need of an answer and it was not necessarily the OPs issue (no indication if they were using Windows), but since I got here through my own research into this problem, I figured I'd add the answer.
This happened also to me:
I simply restarted my local docker daemon, and could login to the Artifactory with no error message.
this one did it for me docker-machine regenerate-certs --client-certs
Whenever you face below problem please set your date and time correct:
"Error while pulling image: Get https://index.docker.io/v1/repositories/library/ubuntu/images: x509: certificate has expired or is not yet valid"
use below command for linux system to set the date and time
sudo date --set='Mon Jan 13 14:50:44 IST 2020' "Note"=> if you are from different time zone please set as CST,EST,EDT etc.