Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

entrypoint does not working in Openshift #39

Open
carlpelletier opened this issue May 4, 2018 · 0 comments
Open

entrypoint does not working in Openshift #39

carlpelletier opened this issue May 4, 2018 · 0 comments

Comments

@carlpelletier
Copy link

carlpelletier commented May 4, 2018

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant