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

Use useradd on Alpine when user ID is large #4851

Conversation

DenisRumyantsev
Copy link
Contributor

@DenisRumyantsev DenisRumyantsev commented Jun 17, 2024

Description: The adduser command can be used in Alpine by default without installing any additional packages. Therefore, this command has a higher priority. However, it does not work if the user ID is greater than 256000. In this case, we should install the additional shadow package and use the useradd command instead.

The shadow package will be used in the following cases:

  • if this package is preinstalled in the container;
  • if user ID is outside the range of the adduser command.

Related issue

@KonstantinTyukalov
Copy link
Contributor

@DenisRumyantsev can we just always use the shadow package? Does it have some side effects?

@DenisRumyantsev DenisRumyantsev force-pushed the users/DenisRumyantsev/use-useradd-on-alpine-when-userid-is-large branch 2 times, most recently from 269c74b to 9176033 Compare June 19, 2024 07:05
@DenisRumyantsev
Copy link
Contributor Author

@KonstantinTyukalov I suggest we can use the shadow package always when it is already installed in the container, and don't use it if it is not necessary and it is not installed yet.

@DenisRumyantsev DenisRumyantsev force-pushed the users/DenisRumyantsev/use-useradd-on-alpine-when-userid-is-large branch 2 times, most recently from 08175aa to 0da877d Compare June 19, 2024 18:35
@DenisRumyantsev DenisRumyantsev force-pushed the users/DenisRumyantsev/use-useradd-on-alpine-when-userid-is-large branch from 0da877d to 2831ca6 Compare June 19, 2024 18:41
@DenisRumyantsev DenisRumyantsev merged commit 9c3692c into master Jun 24, 2024
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants