His
His

Reputation: 6043

OpenShift support arbitrary user ids

From this reading on https://docs.openshift.org/latest/creating_images/guidelines.html#openshift-specific-guidelines in the section Support Arbitrary User IDs. It's recommended for:

Example:

RUN chgrp -R 0 /some/directory && \
    chmod -R g=u /some/directory
RUN chmod g=u /etc/passwd
ENTRYPOINT [ "uid_entrypoint" ]
USER 1001

I'm not clear with what all these mean.

Upvotes: 2

Views: 2492

Answers (1)

Graham Dumpleton
Graham Dumpleton

Reputation: 58523

Where is user 1001 defined?

You need to create a non root user account with that user ID.

See: https://github.com/sclorg/s2i-base-container/blob/master/core/Dockerfile#L71

What does g=u mean?

It sets the group permissions for the directory/file to the same as what the user has.

What does group 0 mean?

The root group has group ID of 0.

I've specified in my image the below....*

See the linked example above for how to add non root user.

You must use:

USER 1001

You cannot use an account name as value for USER, it must be an integer value.

Upvotes: 4

Related Questions