I launched Retool software in Openshift. I have error in pod: “user running container is not the expected user, retool_user (uid 1001) in retool_user_group (gid 1001)”. Pod has different UID 1001260000. As I understood Retool requires user – retool_user & group – retool_user_group. I changed GID in Dockerfile with command “RUN groupmod -g 1001260000 retool_user_group”, but i cant change UID with command “RUN usermod -u 1001260000 retool_user”. Docker build is running but doesnt finish this command. In logs I see:
RUN usermod -u 1001260000 retool_user.
=> exporting to image.
=> => exporting layers"
How to solve this problem? Dockerfile:
FROM tryretool/code-executor-service:latest
RUN groupmod -g 1001260000 retool_user_group
RUN usermod -u 1001260000 retool_user
2
The UID and GID of the running user are defined at deployment time within OpenShift. The 1001260000
(which is a overstated high number, this is how you can detect it 99% of the cases) is coming from a concept called user_namespaces (man7.org).
To overwrite the running user in OpenShift, you can define the UID as part of your resource manifest under containers[].securityContext.runAsUser
like:
containers:
- name: container-name
securityContext:
runAsUser: 1001
image: quay.io/...
You can find more details about it at https://www.redhat.com/en/blog/a-guide-to-openshift-and-uids.
1