[英]OpenShift Docker login issue
I have set up a local OpenShift instance and installed the docker registry according to the Red Hat instructions. 我已经按照Red Hat的说明设置了一个本地OpenShift实例并安装了docker注册表。 I am having trouble logging into the internal docker registry, however.
但是,我无法登录到内部docker注册表。 I'm sure it is some gap in my understanding of how Docker and/or OpenShift works.
我确信对Docker和/或OpenShift的工作方式有一定的差距。 I have given my user the admin, cluster-admin, and system:registry roles, which is what I believe I need.
我已经为我的用户赋予了admin,cluster-admin和system:registry角色,这是我认为我需要的。 I login via oc, and then attempt to log into the registry like so:
我通过oc登录,然后尝试登录到注册表,如下所示:
docker login -u $(oc whoami) -e 'xxxxxx' -p $(oc whoami -t) $(hostname):8443
and I get the following response: 我得到以下回应:
Error response from daemon: Unexpected status code [403] : {
"kind": "Status",
"apiVersion": "v1",
"metadata": {},
"status": "Failure",
"message": "User \"system:anonymous\" cannot \"post\" on \"/v1/users/\"",
"reason": "Forbidden",
"details": {},
"code": 403
}
I'm not finding much about this particular error message, so I'm not sure what the heck I'm missing. 我没有找到关于此特定错误消息的太多信息,因此我不确定我到底缺少什么。
Should have been using the internal docker IP: 应该一直在使用内部docker IP:
# oc get svc docker-registry -n default
NAME CLUSTER-IP EXTERNAL-IP PORT(S) AGE
docker-registry 172.30.10.52 <none> 5000/TCP 9h
If you are accessing the docker registry outside the openshift cluster. 如果要在openshift集群之外访问docker注册表。 Theses are the things you will have to do.
这些是您将要做的事情。
Create a route for the service (either from cli or web console). 创建服务的路由(从cli或Web控制台)。
oc create route --service=<registryName>
If you are using self signed certs, add this route to your host machine's insecure docker registry options (depends on what host machine you are using). oc create route --service=<registryName>
如果使用的是自签名证书,请将此路由添加到主机的不安全的docker注册表选项(取决于您使用的主机)。 Then try doing a docker login to the docker registry. 然后尝试通过docker登录到docker注册表。 You said you installed a registry inside openshift, they already have a docker registry running inside openshift.
您说您在openshift内安装了一个注册表,他们已经在openshift内运行了一个docker注册表。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.