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

Dockerfile: run entrypoint as root #99

Closed
wants to merge 1 commit into from

Conversation

babnskidata
Copy link

Hi!

From the commit message:

Since 492b2c56abfc, the entrypoint is executed as 'builder' user. 
Therefore, using a USER_ID and GROUP_ID currently fails: 
groupmod: Permission denied.
groupmod: cannot lock /etc/group; try again later. 
usermod: group '1000' does not exist
chown: changing ownership of '/builder/.bash_logout': Operation not permitted
chown: changing ownership of '/builder/.profile': Operation not permitted
chown: changing ownership of '/builder/.bashrc': Operation not permitted
chown: changing ownership of '/builder': Operation not permitted
error: failed switching to "builder": operation not permitted

As the entrypoint is designed to be executed as root, revert it back.

Reproducible with: docker run --rm -it -e "USER_ID=1000" -e "GROUP_ID=1000" ghcr.io/siemens/kas/kas:4.0
Debuggable with:

docker run --rm -it --entrypoint bash ghcr.io/siemens/kas/kas:4.0
builder@49a8a8928466:/$ USER_ID=1000 GROUP_ID=1000 /kas/container-entrypoint

Since 492b2c5, the entrypoint is executed as 'builder' user.
Therefore, using a USER_ID and GROUP_ID currently fails:
groupmod: Permission denied.
groupmod: cannot lock /etc/group; try again later.
usermod: group '1000' does not exist
chown: changing ownership of '/builder/.bash_logout': Operation not permitted
chown: changing ownership of '/builder/.profile': Operation not permitted
chown: changing ownership of '/builder/.bashrc': Operation not permitted
chown: changing ownership of '/builder': Operation not permitted
error: failed switching to "builder": operation not permitted

As the entrypoint is designed to be executed as root, revert it back.

Signed-off-by: Benjamin Bara <[email protected]>
@jan-kiszka
Copy link
Collaborator

@jan-kiszka jan-kiszka closed this Aug 20, 2023
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

Successfully merging this pull request may close these issues.

2 participants