minishift-为openshift内部docker注册表设置身份验证?

时间:2019-10-21 16:04:59

标签: openshift docker-registry minishift

在Ubuntu桌面上,使用minishift启动OC群集。 docker注册表在默认名称空间中可用。

如何为openshift集群中运行的docker注册表设置身份验证? 如何允许像开发人员,系统这样的用户或openshift的任何用户向/从内部Docker注册表中推入/拉出图像?

我已经在openshift中启用了docker服务的路由。

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)

图像流的创建,标记和推送到下面的注册表输出。

 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

0 个答案:

没有答案