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

Feature Request: Support user namespaced containers #483

Open
nyonson opened this issue Aug 10, 2021 · 4 comments
Open

Feature Request: Support user namespaced containers #483

nyonson opened this issue Aug 10, 2021 · 4 comments
Labels
enhancement New feature or request up for grabs Anyone can work on this

Comments

@nyonson
Copy link

nyonson commented Aug 10, 2021

Is your feature request related to a problem? Please describe.
Podman (and maybe Docker?) now supports user namespaced containers. There are security benefits to running containers this way instead of depending on a root-ful daemon. User namespaced containers change how user/group ids are mapped between the host and container systems. This means that the USERID and GROUPID variables passed around in Polar's docker filers no longer work as expected in user namespaced containers and the containers fail to start.

Describe the solution you'd like
I am not sure the best way to support user namespaced containers while not breaking current patterns, but ideally some setting could disable the USERID/GROUPID variables and let the standard mapping take over.

Additional context
For now I think I can get around this by building my own containers which just drop the current entrypoint logic to map USERID/GROUPID.

@nyonson nyonson added the enhancement New feature or request label Aug 10, 2021
@jamaljsr
Copy link
Owner

Thanks for pointing this out @nyonson. I was not aware of these user namespaced containers. The current way that Polar handles user permissions is not ideal, but it was the only way I could get it working across all 3 platforms at the time. I'll have to investigate more on Podman/Docker namespaces to see if it's possible to improve or simplify the implementation. Appreciate it 👍

@nyonson
Copy link
Author

nyonson commented Sep 8, 2021

The part of the current implementation which doesn't play nice with rootless containers is how the user are created dynamically in the docker-entrypoint.sh script. That requires the containers to start out running as root in order to create the new users. Could we instead base the user creation into the Dockerfile and use the User field in the docker-compose definition?

@jamaljsr
Copy link
Owner

Could we instead base the user creation into the Dockerfile and use the User field in the docker-compose definition?

My bad @nyonson, I haven't had a chance to look into this. I don't know if this would be possible atm.

@jamaljsr jamaljsr added the up for grabs Anyone can work on this label Dec 19, 2023
@amackillop
Copy link

I'm interested in trying to get this to work. Any tips to get started?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request up for grabs Anyone can work on this
Projects
None yet
Development

No branches or pull requests

3 participants