-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
rootless: optional support for generating config with subuid map #1692
Conversation
298d6cd
to
5774f21
Compare
5774f21
to
2fce970
Compare
updated to support execution within userns |
2fce970
to
be7177e
Compare
I'm not a huge fan of this, though I might still be convinced. However, there is another problem, which is that in many cases users shouldn't be mapping all of their allocated subuids/subgids for each container. They should be using independent sets of uids and gids (this is something that Docker gets very, very wrong -- though there are technical reasons why they made the compromise -- but we shouldn't be repeating that mistake). And example of this done more correctly is rkt or LXC. With that in mind, I'm not sure that you could automatically decide what the best sub-range is of a user's |
How about adding UID/GID range fields to RootlessOpts? cc @jessfraz |
I'm not sure the best approach here to be honest, but not making the same mistakes as docker sounds good haha |
Just to note that LXC also does the right thing here -- they allocate sub-sections of the available |
libcontainer/specconv/example.go
Outdated
spec.Linux.GIDMappings = append(spec.Linux.GIDMappings, | ||
specs.LinuxIDMapping{ | ||
HostID: uint32(subgid.SubID), | ||
ContainerID: uint32(uNextContainerID), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: will fix immediately
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done (cc @jessfraz )
e835e87
to
aa80caf
Compare
aa80caf
to
9eecb7d
Compare
9eecb7d
to
1e44f9e
Compare
c4ab5c9
to
b3069aa
Compare
Removed CLI and added godoc ,as this seems controversial, although already used in img and rootless BuildKit. |
Signed-off-by: Akihiro Suda <[email protected]>
rebased |
b3069aa
to
898ae8c
Compare
Any thought? |
// | ||
// When running in userns, MapAllSubIDs is ignored and | ||
// /proc/self/[ug]id_map entries are used. | ||
MapAllSubIDs bool |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm going to add more options such as KeepNetworkNamespace
as well after this PR gets merged.
// | ||
// MapAllSubIDs requires newuidmap(1) and newgidmap(1) with suid bit. | ||
// | ||
// When running in userns, MapAllSubIDs is ignored and |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As this is very confusing, I'm temporary closing this PR.
Please also see #1837
Signed-off-by: Akihiro Suda [email protected]
runc spec --rootless --rootless-subuid
generates a config with multiple uidMappings and gidMappings. (See #1529)