In the Ubuntu desktop, started the OC cluster using minishift. The docker registry is available in the default namespace.
How to setup the authentication for the docker registry running inside the openshift cluster? How to allow the users like developer,system or any users of openshift to push/pull images to/from the internal docker registry?
I have enabled the route for the docker service in the openshift.
root@desktop:~# docker login -p 5d2XKusYJ9xB6sg1_uRfwPE8Ap3FQMg8_MrR9IEw3N8 -u aprasath docker-registry-default.127.0.0.1.nip.io
WARNING! Using --password via the CLI is insecure. Use --password-stdin.
WARNING! Your password will be stored unencrypted in /root/.docker/config.json.
Configure a credential helper to remove this warning. See
https://docs.docker.com/engine/reference/commandline/login/#credentials-store
Login Succeeded
root@desktop:~# docker push docker-registry-default.127.0.0.1.nip.io/myproject/hello-world
The push refers to repository [docker-registry-default.127.0.0.1.nip.io/myproject/hello-world]
af0b15c8625b: Pushing [==================================================>] 3.584kB
unauthorized: authentication required
root@desktop:~# minishift addons list
- admin-user : enabled P(0)
- registry-route : enabled P(0)
The imagestream creation, tag and push to registry output below.
root@desktop:~# oc create imagestream ghost
Error from server (AlreadyExists): imagestreams.image.openshift.io "ghost" already exists
root@desktop:~ docker tag ghost docker-registry-default.127.0.0.1.nip.io/myproject/ghost:latest
root@desktop:~ docker push docker-registry-default.127.0.0.1.nip.io/myproject/ghost:latest
The push refers to repository [docker-registry-default.127.0.0.1.nip.io/myproject/ghost]
6545fabd1db4: Pushing [==================================================>] 4.096kB
e1b5357c9029: Pushing [==================================================>] 205.2MB/205.2MB
2f546e8c419e: Pushing [==================================================>] 25.33MB/25.33MB
2f5caec27732: Pushing [==================================================>] 1.287MB/1.287MB
da4dc4c42b60: Pushing [==================================================>] 3.584kB
24ad92b56299: Waiting
4eab4d25c303: Waiting
e2dd6cf79115: Waiting
67ecfc9591c8: Waiting
unauthorized: authentication required