Skip to content

Commit

Permalink
dockerTools: fix permissions on /nix/store
Browse files Browse the repository at this point in the history
  • Loading branch information
Johan Thomsen committed Jul 30, 2020
1 parent abe07bb commit 9f86685
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions pkgs/build-support/docker/stream_layered_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,10 @@ def apply_filters(ti):
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
Expand All @@ -84,8 +88,8 @@ def dir(path):
# 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)
Expand Down

0 comments on commit 9f86685

Please sign in to comment.