mirror of
https://github.com/NixOS/nixpkgs.git
synced 2025-02-16 17:14:00 +00:00
nixos/dockerTools: fix includeStorePaths when enableFakechroot
After #268458, when setting `enableFakechroot = true` and `includeStorePaths = false`, some of the store paths were getting included into the image anyway, thru `bind-paths`. This resulted in unexpectedly large images. Now, the images will not contain any store paths under those circumstances.
This commit is contained in:
parent
0eb6d4fb0c
commit
8353fad13d
@ -75,6 +75,8 @@ in {
|
||||
docker.succeed("${examples.helloOnRootNoStore} | docker load")
|
||||
docker.fail("docker run --rm hello | grep -i hello")
|
||||
docker.succeed("docker image rm hello:latest")
|
||||
with subtest("Ensure ZERO paths are added to the store"):
|
||||
docker.fail("${examples.helloOnRootNoStore} | ${pkgs.crane}/bin/crane export - - | tar t | grep 'nix/store/'")
|
||||
with subtest("includeStorePath = false; works with mounted store"):
|
||||
docker.succeed("${examples.helloOnRootNoStore} | docker load")
|
||||
docker.succeed("docker run --rm --volume ${builtins.storeDir}:${builtins.storeDir}:ro hello | grep -i hello")
|
||||
|
@ -922,6 +922,7 @@ rec {
|
||||
--sort name \
|
||||
--exclude=./proc \
|
||||
--exclude=./sys \
|
||||
--exclude=.${builtins.storeDir} \
|
||||
--numeric-owner --mtime "@$SOURCE_DATE_EPOCH" \
|
||||
--hard-dereference \
|
||||
-cf $out/layer.tar .
|
||||
|
@ -637,6 +637,7 @@ rec {
|
||||
];
|
||||
config.Cmd = [ "hello" ];
|
||||
includeStorePaths = false;
|
||||
enableFakechroot = true;
|
||||
};
|
||||
|
||||
etc =
|
||||
|
Loading…
Reference in New Issue
Block a user