diff options
author | Florian Klink <flokli@flokli.de> | 2022-08-01 13:41:41 +0700 |
---|---|---|
committer | Florian Klink <flokli@flokli.de> | 2022-08-01 13:41:41 +0700 |
commit | 6e254a6c353b800234245daa071786bb5e6f44cd (patch) | |
tree | b2fc4d2b8cce38e3f7f28480397702dafb578655 | |
parent | 4393ed86794fa4e66161829d56937c8f135697ce (diff) | |
download | nixpkgs-6e254a6c353b800234245daa071786bb5e6f44cd.tar nixpkgs-6e254a6c353b800234245daa071786bb5e6f44cd.tar.gz nixpkgs-6e254a6c353b800234245daa071786bb5e6f44cd.tar.bz2 nixpkgs-6e254a6c353b800234245daa071786bb5e6f44cd.tar.lz nixpkgs-6e254a6c353b800234245daa071786bb5e6f44cd.tar.xz nixpkgs-6e254a6c353b800234245daa071786bb5e6f44cd.tar.zst nixpkgs-6e254a6c353b800234245daa071786bb5e6f44cd.zip |
nixos/doc: update contents to copyToRoot
contents is deprecated now, use the copyToRoot attribute.
-rw-r--r-- | doc/builders/images/dockertools.section.md | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/doc/builders/images/dockertools.section.md b/doc/builders/images/dockertools.section.md index 89b35841d75..d8deb6cfbc8 100644 --- a/doc/builders/images/dockertools.section.md +++ b/doc/builders/images/dockertools.section.md @@ -326,8 +326,8 @@ Creating base files like `/etc/passwd` or `/etc/login.defs` is necessary for sha If your primary goal is providing a basic skeleton for user lookups to work, and/or a lesser privileged user, adding `pkgs.fakeNss` to -`build*Image.contents` might be the better choice than a custom script running -`useradd` and friends. +the container image root might be the better choice than a custom script +running `useradd` and friends. It provides a `/etc/passwd` and `/etc/group`, containing `root` and `nobody` users and groups. @@ -343,9 +343,10 @@ to `bashInteractive` (as `/bin/sh` is configured as a shell). buildImage { name = "shadow-basic"; - contents = [ - binSh - fakeNss - ] + copyToRoot = pkgs.buildEnv { + name = "image-root"; + paths = [ binSh pkgs.fakeNss ]; + pathsToLink = [ "/bin" "/etc" "/var" ]; + }; } ``` |