-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
namespaces: allow configuring keep-id userns size #24882
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Giuseppe Scrivano <[email protected]>
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: giuseppe The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
8f3662a
to
67318cf
Compare
LGTM |
How should this be integrated in to newer projects like distrobox? A version check to see if podman is > 5.3.1? Othersize size is undefined. |
Introduce a new option "size" to configure the maximum size of the user namespace configured by keep-id. Closes: containers#24837 Signed-off-by: Giuseppe Scrivano <[email protected]>
67318cf
to
5f2b57b
Compare
I'm going to test this this weekend and try to integrate it in to distrobox to see if this works for my use case. I'll report back if it's a good solution for this problem. |
personally I don't like version checks, it is error prone and it won't work if we backport the feature to older releases. You could just run a simple container with that option and see if it works |
even better if you specify the correct size you plan to use, so the image is copied and chowned only once |
Okay, thanks for the advice. I guess follow-up question is whether this will cause each container to have a different set of UIDs if I've never run --userns=auto before? It's a bit confusing how these interact. |
|
Good news: I have tested this with a modified distrobox and it works well! I can now run my userns=auto containers AND userns=keep-id:size=65536 distroboxes on my machine. Bad news: I started looking at how to use this in distrobox. I can't guarantee 'podman run --rm --userns=keep-id:size=65336 $IMG /bin/true' will work as I can't guarantee the image will have /bin/true or really any specific binary. Would it be safe to take exit code 127 as success in this case? My current code looks like this:
Edit: This works perfectly fine, but it seems a little non-ideal. |
would be enough to just create the container without running it? |
Running this on a regular podman doesn't error:
```
podman create archlinux --userns=keep-id:size=65536
```
Despite no size argument being implemented.
…On Sat, Dec 21, 2024 at 11:06:00PM -0800, Giuseppe Scrivano wrote:
would be enough to just create the container without running it? `podman create` instead of `podman run`
--
Reply to this email directly or view it on GitHub:
#24882 (comment)
You are receiving this because you commented.
Message ID: ***@***.***>
|
Introduce a new option "size" to configure the maximum size of the user namespace configured by keep-id.
Closes: #24837