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: Fix bug by adding group by id not name #625

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

sjrct
Copy link

@sjrct sjrct commented May 29, 2024

I was running into this issue on solus trying to build the image with a specified gid when the gid (15) already existed.

When a group already exists with the specified gid, usermod -f will silently added the group with a default new gid (eg 1001). So worker ends up with an extra useless group rather than the one specified. This fixes the issue by adding the group by the gid rather than by the name, so worker always ends up with the gid you want (even if that isn't the newly created optical group)

Copy link

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💖 Thanks for opening your first pull request here! 💖

When a group already exists with the specified gid, usermod with -f will
silently added the group with a default new gid. So worker ends up with
an extra useless group rather than the one specified.

Signed-off-by: Chris Harding <sjrct@users.noreply.github.com>
@sjrct sjrct force-pushed the fix-group-already-exists branch from 3fcb6bd to b40ec2d Compare May 29, 2024 16:37
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.

1 participant