diff --git a/pkgs/build-support/docker/stream_layered_image.py b/pkgs/build-support/docker/stream_layered_image.py index 8ffd336fce49..ffb6ba0ade4b 100644 --- a/pkgs/build-support/docker/stream_layered_image.py +++ b/pkgs/build-support/docker/stream_layered_image.py @@ -74,6 +74,10 @@ def archive_paths_to(obj, paths, mtime, add_nix, filter=None): ti.gname = "root" return filter(ti) + def nix_root(ti): + ti.mode = 0o0555 # r-xr-xr-x + return ti + def dir(path): ti = tarfile.TarInfo(path) ti.type = tarfile.DIRTYPE @@ -84,8 +88,8 @@ def archive_paths_to(obj, paths, mtime, add_nix, filter=None): # these directories first when building layer tarballs. But # we don't need them on the customisation layer. if add_nix: - tar.addfile(apply_filters(dir("/nix"))) - tar.addfile(apply_filters(dir("/nix/store"))) + tar.addfile(apply_filters(nix_root(dir("/nix")))) + tar.addfile(apply_filters(nix_root(dir("/nix/store")))) for path in paths: path = pathlib.Path(path)