问题
I've exposed my openshift registry:
$ oc get routes -n default
NAME HOST/PORT PATH SERVICES PORT TERMINATION WILDCARD
docker-registry docker-registry-default.192.168.99.104.nip.io docker-registry 5000-tcp None
Nevertheless, I'm trying to get access on that registry, but I've not been able to figure out what's wrong:
docker login -p ngRslZJYJ40WxBA6YQbE5nMDK1Gh-cSWgnJCKR4EJ2I docker-registry-default.192.168.99.104.nip.io -u unused
This command keeps stuck.
回答1:
If the route is configured with HTTPS and the cert is a self-signed cert then docker has to be configured to trust the cert.
Steps:
- On the host where docker is running, create a folder under
/etc/docker/certs.d/
named after the OpenShift Docker Registry URL:mkdir -p /etc/docker/certs.d/docker-registry-default.192.168.99.104.nip.io
- Place in that folder the cert of the CA that signed the cert of the OpenShift Docker Registry:
/etc/docker/certs.d/docker-registry-default.192.168.99.104.nip.io/ca.crt
来源:https://stackoverflow.com/questions/51045704/openshift-get-access-to-openshift-docker-registry