Docker pull error : x509: certificate has expired or is not yet valid

后端 未结 13 1941
轻奢々
轻奢々 2021-02-19 00:13

Description of problem:

I\'m trying to pull ubuntu from the public registry with this command :

docker pull ubuntu

And then i got this

相关标签:
13条回答
  • 2021-02-19 00:29

    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

    0 讨论(0)
  • 2021-02-19 00:32

    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.

    0 讨论(0)
  • 2021-02-19 00:33

    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.

    0 讨论(0)
  • 2021-02-19 00:34

    This happened also to me:

    • while trying to login to an Artifactory.
    • when my local docker daemon has been running for a couple weeks.

    I simply restarted my local docker daemon, and could login to the Artifactory with no error message.

    0 讨论(0)
  • 2021-02-19 00:35

    this one did it for me docker-machine regenerate-certs --client-certs

    0 讨论(0)
  • 2021-02-19 00:38

    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.

    0 讨论(0)
提交回复
热议问题