Skip to content

entrypoint does not working in Openshift #39

Open
@carlpelletier

Description

Hi the context of Openshift and secure SCC, the entrypoint is not correct:

When the entrypoint will be call, the value of USER_NAME will be empty.

sed "s@${USER_NAME}:x:\${USER_ID}:@${USER_NAME}:x:${USER_ID}:@g" /etc/passwd.template

I think the best way of settings this is by using the suggestion in the Openshift Doc:

Change in the Dockerfile

# All permission must be corrected in the Image too
RUN chmod g=u /etc/passwd 
ENTRYPOINT [ "uid_entrypoint" ]
USER 1001

Change in entrypoint

if ! whoami &> /dev/null; then
  if [ -w /etc/passwd ]; then
    echo "${USER_NAME:-default}:x:$(id -u):0:${USER_NAME:-default} user:${HOME}:/sbin/nologin" >> /etc/passwd
  fi
fi

I understand correctly?

Thanks!

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions