I am running Docker inside a VM (which runs Fedora Server 35) with access to the Internet since I am able to pull public images. I need to pull also some private images but I am running into the following issue:
docker login myprivateserver:5000
Username: <myusername>
Password: ********
Error response from daemon: Get "https://myprivateserver:5000//v2/": x509: certificate signed by unknown authority
I have followed the docs but it does not seem to be working. Here is what I have done so far:
- create the directory
/etc/docker/certs.d/myprivateserver:5000
- copied the cert file to the above route and renamed it as
ca.crt
I have read a lot of posts here in SO and all of them say that's the way to go but it just doesn't work for me and I don't get why.
Can I get some help? What am I missing here?
Note: I have obtained the
ca.cert
file by accessing the URLhttps://myprivateserver:5000
from the browser and then downloading the file from there.
Note 2:
myprivateserver
is a placeholder I use in order to no discard the current URL (security reasons)
openssl x509 -text -noout -in /etc/docker/certs.d/myprivateserver:5000/ca.crt
)unable to load certificate
.cer
I renamed that into.crt
but that is wrong. The correct way to convertCER
intoCRT
is:openssl x509 -inform DER -in <certname>.cer -out <certname>.crt
. Doing so I was able to properly login into the private repository and pull the needed images.