docker push with Docker Desktop on WSL2 doesn't trust private CA

1.4k Views Asked by At

From Ubuntu running in WSL2, I'm attempting to push a docker image to a private docker registry. It fails with the following error:

Get "https://docker.example.com/v2/": x509: certificate signed by unknown authority

I'm using Docker Desktop with the WSL2 integration enabled.

Where do I install the root CA certificate so that docker can find it? I've tried the following:

  • Installing it in the Trusted Root Certification Authority store in Windows and restarting Docker Desktop Service.
  • Installing it in the Ubuntu CA store.

Neither of these works.

1

There are 1 best solutions below

1
Gorka Lertxundi On

The CA certificate should be placed in the directory C:\ProgramData\docker\certs.d\. Then restart the docker service with restart-service docker from an admin powershell.