How to run all pods with specific user in Openshift Container Platform 3?

Solution Verified - Updated -

Issue

  • In OCP 3.3.0.32 environment run pods with different IDs. Example: Project A runs with uid 100013000 and Project B runs with uid 100014000. How to run pods with a specific user?

  • I did the changes in the Dockerfile in order to put the user in the /etc/passwd

RUN useradd -u 1001 -r -g 0 -d /var/lib/test -s /sbin/nologin -c "test example" example
  • But we get a getpwuid error:
The message “KeyError: 'getpwuid(): uid not found: 1000340000'”
  • How can I correctly write the Dockerfile in order to deploy successfully my pp in OpenShift with custom UID

Environment

  • Red Hat Openshift Container Platform
    • 3.2 and later

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content