0
votes

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.

2
Is this with Minishift or just oc cluster up? - Graham Dumpleton
minishift. This is my minishift command: minishift start --openshift-version v3.7.0 --vm-driver=virtualbox --no-proxy=".cluster.local,.svc,172.30.0.1" --http-proxy=http://<host>:<port> --https-proxy=http://<host>:<port> --docker-env HTTP_PROXY=http://<host>:<port> --docker-env HTTPS_PROXY=http://<host>:<port> - Jordi
If using Minishift, you can run minishift docker-env and access it direct instead of via the route. - Graham Dumpleton

2 Answers

0
votes

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
0
votes

Add the following to your host /etc/hosts file:

<router IP> docker-registry-default.192.168.99.104.nip.io

You can get the router IP by:

oc get svc -n default