-
Notifications
You must be signed in to change notification settings - Fork 94
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
Support for large UIDs #176
Comments
Adding a comment so at least the current state is clear to users, and specifically, why high UIDs are not possible by default in Finch:
Inside the Lima VM, nerdctl (and of course containerd/buildkit/runc) are installed, and by default nerdctl installs rootlesskit and starts containerd in rootless mode. This means that subordinate UID/GID maps are in place when containers are running inside the Lima VM. By default on most (all?) Linux distros, the subordinate ranges for an ID are given out in 64K chunks (2^16-1); as you can see above the root ID inside the container is mapped to the macOS UID/GID pair (504:1000 for me), and then rest of the 64K ID space is rooted at 100000 for me. Once an ID is encountered above the 2^16-1 limit, the runtime will fail to map the ID to a valid UID or GID and fail. Larger maps can be created, and potentially at Finch VM init the subordinate maps could be specified as one possible solution if there is a requirement to use large IDs. |
Since we own the VM, I wonder if we can just do something like
in a provisioning script? Here's some resources I found that might help debug/fix this issue:
The python program on the rootlesscontaine.rs website is interesting, but I haven't got around to trying it yet |
Issue on the upstream Lima: |
This can be fixed by either modifying the
However there maybe some side effects of increasing uid count inside a container and with overlapping mappings. |
We may want to consider adding this as a config option in Finch and/or Lima. It should be fairly simple to (optionally) run the |
Related issue. #80 |
The large uid/guid issue was resolved by switching to rootful container inside VM. #196 |
Describe the bug
Currently when trying to use a large UID inside a container, you will receive an error like:
Steps to reproduce
finch build -t repro . && finch run -it --rm repro
)su
to the user with a large UID inside the container:Expected behavior
Should be able to use the user inside the container
Screenshots or logs
If applicable, add screenshots or logs to help explain your problem.
Additional context
Just as an aside, this was originally reported to me by a user on Slack, so the repro condition may not exactly align with what they were doing. It's also debatable whether this is a bug or a feature request.
Initially, this seems to be related to the fact that Finch uses a rootless containerd setup.
The text was updated successfully, but these errors were encountered: