Jenkins docker exec的类似选项-u<;用户>;在openshift中

Jenkins docker exec的类似选项-u<;用户>;在openshift中,jenkins,kubernetes,openshift,openshift-client-tools,openshift-enterprise,Jenkins,Kubernetes,Openshift,Openshift Client Tools,Openshift Enterprise,我有一个Jenkins吊舱在OpenShift运行 我已根据为我的项目启用了anyuid 但是,由于以下问题,我无法获取初始管理员密码 <html><head><meta http-equiv='refresh' content='1;url=/login?from=%2F' /><script>window.location.replace('/login?from=%2F');</script>&l

我有一个Jenkins吊舱在OpenShift运行

我已根据为我的项目启用了anyuid

但是,由于以下问题,我无法获取初始管理员密码

<html><head><meta http-equiv='refresh' content='1;url=/login?from=%2F'                  /><script>window.location.replace('/login?from=%2F');</script></head><body     style='background-color:white; color:white;'>


Authentication required
<!--
You are authenticated as: anonymous
Groups that you are in:

 Permission you need to have (but didn't): hudson.model.Hudson.Read
 ... which is implied by: hudson.security.Permission.GenericRead
 ... which is implied by: hudson.model.Hudson.Administer
-->
但是sudo软件包并没有安装在Jenkins吊舱中。 我试过su-I,但它要求的是根密码,我不知道

在Docker中,我使用Docker exec-u root选项以root身份登录。 但我在oc中看不到任何这样的选项。我们有没有其他办法来解决这个问题?

当您执行pod时,您最初登录到pod的用户是什么?您使用的是什么图像来启动pod?为什么首先需要以root用户身份运行?解释你试图解决的问题。如果您知道这一点,而不仅仅是您正在尝试使用的解决方案,那么您可能会建议一种不需要root的更好的方法。
sudo usermod -a -G root jenkins