dockerTools: Fix streamLayeredImage for symlinks
When archiving `/nix/store/foo` and `foo` is itself a symlink, we must not traverse the symlink target, but archive the `foo` symlink itself
This commit is contained in:
parent
56bb1b0f7a
commit
08b0d02944
1 changed files with 5 additions and 1 deletions
|
@ -83,7 +83,11 @@ def archive_paths_to(obj, paths, mtime):
|
|||
|
||||
for path in paths:
|
||||
path = pathlib.Path(path)
|
||||
files = itertools.chain([path], path.rglob("*"))
|
||||
if path.is_symlink():
|
||||
files = [path]
|
||||
else:
|
||||
files = itertools.chain([path], path.rglob("*"))
|
||||
|
||||
for filename in sorted(files):
|
||||
ti = append_root(tar.gettarinfo(filename))
|
||||
|
||||
|
|
Loading…
Reference in a new issue