diff --git a/nixos/tests/docker-tools.nix b/nixos/tests/docker-tools.nix index d2c2ca286ff6..31c5a5909c3d 100644 --- a/nixos/tests/docker-tools.nix +++ b/nixos/tests/docker-tools.nix @@ -388,7 +388,7 @@ import ./make-test-python.nix ({ pkgs, ... }: { with subtest("The image contains store paths referenced by the fakeRootCommands output"): docker.succeed( - "docker run --rm ${examples.layeredImageWithFakeRootCommands.imageName} /hello/bin/hello" + "docker run --rm ${examples.layeredImageWithFakeRootCommands.imageName} /hello/bin/layeredImageWithFakeRootCommands-hello" ) with subtest("exportImage produces a valid tarball"): diff --git a/pkgs/build-support/docker/examples.nix b/pkgs/build-support/docker/examples.nix index 0f7c3bd28208..3861c25caa46 100644 --- a/pkgs/build-support/docker/examples.nix +++ b/pkgs/build-support/docker/examples.nix @@ -507,7 +507,11 @@ rec { fakeRootCommands = '' mkdir -p ./home/jane chown 1000 ./home/jane - ln -s ${pkgs.pkgsStatic.hello} ./hello + ln -s ${pkgs.hello.overrideAttrs (o: { + # A unique `hello` to make sure that it isn't included via another mechanism by accident. + configureFlags = o.configureFlags or "" + " --program-prefix=layeredImageWithFakeRootCommands-"; + doCheck = false; + })} ./hello ''; };