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

Implement optional standard user/group creation at build #29

Open
yannoff opened this issue Jan 23, 2021 · 1 comment
Open

Implement optional standard user/group creation at build #29

yannoff opened this issue Jan 23, 2021 · 1 comment
Assignees
Labels
TODO Planned evolution

Comments

@yannoff
Copy link
Owner

yannoff commented Jan 23, 2021

Problem

Though in many scenarios, running the container as an arbitrary user may be perfectly acceptable, there are some use cases in which the user must be known to the system.

To list a few of them:

Composer

When composer is run as an arbitrary user, it will use /.composer for COMPOSER_HOME instead of ~/.composer, which may result in permission issues.

Moreover, it's impossible to chown that particular directory in the build, since the UID/GID of the user is unknown at this time.

The only remaining choice would be then to chmod the /.composer dir to 777 mode, which is, needless to say, the worth practice ever.

SSH

Every command or process using the SSH protocol will search the default ~/.ssh folder for private/public keys, known hosts, etc... which does not exist for an arbitrary user.

This is the case when the composer.json refers to private repositories with ssh-fashion urls, like [email protected].

Solution

Implement a USER build arg (plus an optional GROUP one) which will trigger - if not empty - the standard user / group creation during build with the given USER as user id / GROUP as group id.

If USER is set but GROUP has been left empty, the USER value will be used for the group id.

@yannoff yannoff self-assigned this Jan 23, 2021
@yannoff yannoff added the TODO Planned evolution label Jan 23, 2021
@yannoff yannoff changed the title Add a standard user/group Implement optional standard user/group creation at build Jan 23, 2021
@yannoff
Copy link
Owner Author

yannoff commented Jul 20, 2021

Additionally, a USERLAND build arg, representing the standard user owned directories should be implemented.

Those dirs will be created at build time and chowned to $USER:$GROUP

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

No branches or pull requests

1 participant