about summary refs log tree commit diff
path: root/doc/build-helpers
diff options
context:
space:
mode:
authorKevin Brubeck Unhammer <unhammer@fsfe.org>2024-01-25 16:10:21 +0100
committerGitHub <noreply@github.com>2024-01-25 16:10:21 +0100
commitad99ac9356a875b3e2afbf020a4a7d58f03417dd (patch)
tree8091c927dcdf775cba8555d88e32044294be7f37 /doc/build-helpers
parent1cbd2ac8f8174b90c1a4aa12230f59a6eb7c3690 (diff)
downloadnixlib-ad99ac9356a875b3e2afbf020a4a7d58f03417dd.tar
nixlib-ad99ac9356a875b3e2afbf020a4a7d58f03417dd.tar.gz
nixlib-ad99ac9356a875b3e2afbf020a4a7d58f03417dd.tar.bz2
nixlib-ad99ac9356a875b3e2afbf020a4a7d58f03417dd.tar.lz
nixlib-ad99ac9356a875b3e2afbf020a4a7d58f03417dd.tar.xz
nixlib-ad99ac9356a875b3e2afbf020a4a7d58f03417dd.tar.zst
nixlib-ad99ac9356a875b3e2afbf020a4a7d58f03417dd.zip
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>
Diffstat (limited to 'doc/build-helpers')
-rw-r--r--doc/build-helpers/images/dockertools.section.md12
1 files changed, 12 insertions, 0 deletions
diff --git a/doc/build-helpers/images/dockertools.section.md b/doc/build-helpers/images/dockertools.section.md
index e732e0472926..d063f1961d89 100644
--- a/doc/build-helpers/images/dockertools.section.md
+++ b/doc/build-helpers/images/dockertools.section.md
@@ -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.
 
+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}
 
 If your primary goal is providing a basic skeleton for user lookups to work,