-
-
Notifications
You must be signed in to change notification settings - Fork 14.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
userns for nixbld? #107090
Comments
If I understand correctly, your goal is to create multi-arch docker images and one way to accomplish this is by having user namespace support in Nix. I think @Ericson2314 did some work during NixCon Hackday 2020 on a PR that might make this easier. I'm a little concerned that it reduces the portability of Nix to restrictive Linux environments like hardened installations or containers. We can probably address that with Regarding your goal of creating multi-arch images, did you try uploading the skopeo-generated image through other means? It seems like skopeo may be suitable for combining the images, but just not for uploading it, at this time. It's sort of the opposite of what you tried in your comment here. Alternatively, it may be possible to improve buildah, so that it does only attempts to set up user namespaces when it needs them. That's of course assuming it doesn't need it in this case. |
As mentioned in this ticket, even I'm not convinced this is something Nix should do. I agree, if it does happen, it should be a separate feature for now.
The directory created by the skopeo copies isn't valid, or at least it doesn't look like any multi-image manifest list I've seen thus far. I also haven't found any tool that could push it. I have found that skopeo will copy a multi-image OCI path created by buildah when given an otherwise ignored tag (the directory created by the push command here: containers/buildah#2858 (comment)). This OCI directory is very similar to the output created by the double skopeo copy. I think it's close enough that a little shell scripting and turn one into the other. I'll give this a try after work, if successful I won't need buildah at all. I'm going to go ahead and close this in the meantime. |
Describe the bug
In a multi-user installation of nix, the builders do not have uid and gid mappings to use user namespaces. Adding them manually does not work, as
/etc/subuid
and/etc/subgid
are not in the sandbox.To Reproduce
Expected behavior
If it's decided builders should have access to user namespaces, we should allow user namespaces and this should build a multi-architecture OCI list in
$out
.Additional context
I'm honestly not sure this is something we want to do, but I didn't see an issue for this functionality.
I'll continue to investigate ways of building multi-architecture images in Nix. Ideally this would be supported by skopeo, but see containers/skopeo#1136. At worse, I'll create a builder that manually builds the structure and list manifest. /cc @roberth in case you have an idea for this aspect.
Notify maintainers
Metadata
"x86_64-linux"
Linux 5.4.81, NixOS, 20.09.2205.65c9cc79f1d (Nightingale)
yes
yes
nix-env (Nix) 2.3.9
"nixos-20.09.2205.65c9cc79f1d, nixos-hardware"
"home-manager-20.09"
/nix/var/nix/profiles/per-user/root/channels/nixos
Maintainer information:
The text was updated successfully, but these errors were encountered: