summary refs log tree commit diff
path: root/pkgs/build-support/docker
diff options
context:
space:
mode:
authorJohan Thomsen <jth@dbc.dk>2020-07-30 16:20:50 +0200
committerJohan Thomsen <jth@dbc.dk>2020-07-30 16:20:50 +0200
commit9f86685cc76991e983bf126a37e3f7f319247ba8 (patch)
tree7c0c355580380e77458ef03d2d076e8f43ed8edd /pkgs/build-support/docker
parentabe07bbd965eb99338735f0a115dd854a94831b5 (diff)
downloadnixpkgs-9f86685cc76991e983bf126a37e3f7f319247ba8.tar
nixpkgs-9f86685cc76991e983bf126a37e3f7f319247ba8.tar.gz
nixpkgs-9f86685cc76991e983bf126a37e3f7f319247ba8.tar.bz2
nixpkgs-9f86685cc76991e983bf126a37e3f7f319247ba8.tar.lz
nixpkgs-9f86685cc76991e983bf126a37e3f7f319247ba8.tar.xz
nixpkgs-9f86685cc76991e983bf126a37e3f7f319247ba8.tar.zst
nixpkgs-9f86685cc76991e983bf126a37e3f7f319247ba8.zip
dockerTools: fix permissions on /nix/store
Diffstat (limited to 'pkgs/build-support/docker')
-rw-r--r--pkgs/build-support/docker/stream_layered_image.py8
1 files changed, 6 insertions, 2 deletions
diff --git a/pkgs/build-support/docker/stream_layered_image.py b/pkgs/build-support/docker/stream_layered_image.py
index 8ffd336fce4..ffb6ba0ade4 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)