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

Add ability to run things as user in the snippets #10

Open
tfoote opened this issue Jan 9, 2019 · 0 comments
Open

Add ability to run things as user in the snippets #10

tfoote opened this issue Jan 9, 2019 · 0 comments
Labels
enhancement New feature or request

Comments

@tfoote
Copy link
Collaborator

tfoote commented Jan 9, 2019

Talking with @sloretz it would be good to have the ability to do things as the user in the Dockerfile snippets.

I think that the recommended pattern would be that the snippet would switch to the USER command at the top of it and then return to the USER root at the end. To make this useful though a few helper functions would be valuable to let the plugins query for the username to switch to. Alternatively they could ask for their snippet to be run as user.

Also related the user account would need to be setup at the beginning before the snippet and the final USER setting postpended.

This would drive a need for extension point dependencies. And maybe the --user option would drive the --user-account option and anything that wants to run as a user would also require the --user-account option. And we could make sure that user-account is run first.

A slightly more integrated solution would be to allow the snippet to be registered with an option "run as user" and then the switch to and from USER would be handled by rocker instead of by the snippet. This would make it less likely that a snippet would forget to return the USER to root and break everything downstream.

@tfoote tfoote added the enhancement New feature or request label Jan 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant