Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Description of problem:

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

docker pull ubuntu 

And then i got this results (the previous command was working yesterday) :

"Error while pulling image: Get https://index.docker.io/v1/repositories/library/ubuntu/images: x509: certificate has expired or is not yet valid"

docker version :

Client: Version: 1.10.0 API version: 1.22 Go version: go1.5.3 Git commit: 590d510 Built: Thu Feb 4 18:36:33 2016 OS/Arch: linux/amd64  Server: Version: 1.10.0 API version: 1.22 Go version: go1.5.3 Git commit: 590d510 Built: Thu Feb 4 18:36:33 2016 OS/Arch: linux/amd64 

docker info :

Containers: 4 Running: 0 Paused: 0 Stopped: 4 Images: 20 Server Version: 1.10.0 Storage Driver: aufs Root Dir: /var/lib/docker/aufs Backing Filesystem: extfs Dirs: 44 Dirperm1 Supported: true Execution Driver: native-0.2 Logging Driver: json-file Plugins:  Volume: local Network: bridge null host Kernel Version: 3.19.0-49-generic Operating System: Ubuntu 14.04.3 LTS OSType: linux Architecture: x86_64 CPUs: 4 Total Memory: 5.815 GiB Name: ubuntu ID: Y6OO:23T2:BAPU:DVQJ:HJCJ:USEP:T6EU:PMG4:O4M6:46C7:JKPC:BQHT WARNING: No swap limit support 

uname -a :

Linux ubuntu 3.19.0-49-generic #55~14.04.1-Ubuntu SMP Fri Jan 22 11:24:31 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux 

I verify my "date" and everything is good. I don't know where this issue can come from.

like image 666
YOURI ANTENOR-HABAZAC Avatar asked Feb 09 '16 10:02

YOURI ANTENOR-HABAZAC


People also ask

How do I fix x509 certificate signed by unknown authority Docker?

How to resolve Docker x509: certificate signed by unknown authority error. In order to resolve this error, we have to import the CA certificate in use by the ICP into the system keystore. Then, we have to restart the Docker client for the changes to take effect.

What is an x509 error?

If a user attempts to use a self-signed certificate, they will experience the x509 error indicating that they lack trusted certificates. Some smaller operations may not have the resources to utilize certificates from a trusted CA.

How do I fix x509 certificate signed by unknown authority in Windows?

So the solution to is simple – install the Root CA certificates on the server. That's it – now the error should be gone. If you don't know the root CA, open the URL that gives you the error in a browser (i.e. Chrome). Click the lock next to the URL and select Certificate (Valid).


2 Answers

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

like image 77
Dan Ochiana Avatar answered Sep 17 '22 15:09

Dan Ochiana


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.

like image 23
Nathan Hartzell Avatar answered Sep 18 '22 15:09

Nathan Hartzell