From 81b0a20dfaa4a91b4951f037a6b577f90d8339f0 Mon Sep 17 00:00:00 2001 From: tomberek Date: Sat, 7 Dec 2019 04:06:42 -0500 Subject: [PATCH] buildImageWithNixDb: export USER (#74959) dockerTools.buildImageWithNixDb: export USER Changes to Nix user detection (./src/nix-channel/nix-channel.cc#L-166) cause this function to error. Exporting USER fixes this. --- pkgs/build-support/docker/default.nix | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkgs/build-support/docker/default.nix b/pkgs/build-support/docker/default.nix index 37b25232b961..2a25ac04d40f 100644 --- a/pkgs/build-support/docker/default.nix +++ b/pkgs/build-support/docker/default.nix @@ -845,6 +845,9 @@ rec { echo " be better to only have one layer that contains a nix store." export NIX_REMOTE=local?root=$PWD + # A user is required by nix + # https://github.com/NixOS/nix/blob/9348f9291e5d9e4ba3c4347ea1b235640f54fd79/src/libutil/util.cc#L478 + export USER=nobody ${nix}/bin/nix-store --load-db < ${closureInfo {rootPaths = contentsList;}}/registration mkdir -p nix/var/nix/gcroots/docker/