doc: Note on how to use shadowSetup with buildLayeredImage (#267220)

* Note on how to use shadowSetup with buildLayeredImage

* Update doc/build-helpers/images/dockertools.section.md

---------

Co-authored-by: Silvan Mosberger <github@infinisil.com>
This commit is contained in:
Kevin Brubeck Unhammer 2024-01-25 16:10:21 +01:00 committed by GitHub
parent 1cbd2ac8f8
commit ad99ac9356
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -845,6 +845,18 @@ buildImage {
Creating base files like `/etc/passwd` or `/etc/login.defs` is necessary for shadow-utils to manipulate users and groups. Creating base files like `/etc/passwd` or `/etc/login.defs` is necessary for shadow-utils to manipulate users and groups.
When using `buildLayeredImage`, you can put this in `fakeRootCommands` if you `enableFakechroot`:
```nix
buildLayeredImage {
name = "shadow-layered";
fakeRootCommands = ''
${pkgs.dockerTools.shadowSetup}
'';
enableFakechroot = true;
}
```
## fakeNss {#ssec-pkgs-dockerTools-fakeNss} ## fakeNss {#ssec-pkgs-dockerTools-fakeNss}
If your primary goal is providing a basic skeleton for user lookups to work, If your primary goal is providing a basic skeleton for user lookups to work,