rootless: optional support for generating config with subuid map#1692
rootless: optional support for generating config with subuid map#1692AkihiroSuda wants to merge 1 commit intoopencontainers:masterfrom
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.
typo: will fix immediately
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.
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.
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-subuidgenerates a config with multiple uidMappings and gidMappings. (See #1529)