Skip to content

Commit

Permalink
doc/manual: add documentation for non-root container images
Browse files Browse the repository at this point in the history
  • Loading branch information
the-sun-will-rise-tomorrow committed Nov 11, 2024
1 parent 1cfb226 commit 1dda18e
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions doc/manual/source/installation/installing-docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,3 +57,21 @@ $ nix build ./\#hydraJobs.dockerImage.x86_64-linux
$ docker load -i ./result/image.tar.gz
$ docker run -ti nix:2.5pre20211105
```

# Docker image with non-root Nix

If you would like to run Nix in a container under a user other than `root`,
you can build an image with a non-root single-user installation of Nix
by specifying the `uid`, `gid`, `uname`, and `gname` arguments to `docker.nix`:

```console
$ nix build --file docker.nix \
--arg uid 1000 \
--arg gid 1000 \
--argstr uname user \
--argstr gname user \
--argstr name nix-user \
--out-link nix-user.tar.gz
$ docker load -i nix-user.tar.gz
$ docker run -ti nix-user
```

0 comments on commit 1dda18e

Please sign in to comment.