dockerTools: Support files directly under /nix/store
Also makes sure that the files inside a layer added in a sorted order to make the results more deterministic.
This commit is contained in:
@@ -39,6 +39,7 @@ import json
|
||||
import hashlib
|
||||
import pathlib
|
||||
import tarfile
|
||||
import itertools
|
||||
import threading
|
||||
from datetime import datetime
|
||||
from collections import namedtuple
|
||||
@@ -87,10 +88,9 @@ def archive_paths_to(obj, paths, mtime, add_nix, filter=None):
|
||||
tar.addfile(apply_filters(dir("/nix/store")))
|
||||
|
||||
for path in paths:
|
||||
ti = tar.gettarinfo(os.path.join("/", path))
|
||||
tar.addfile(apply_filters(append_root(ti)))
|
||||
|
||||
for filename in pathlib.Path(path).rglob("*"):
|
||||
path = pathlib.Path(path)
|
||||
files = itertools.chain([path], path.rglob("*"))
|
||||
for filename in sorted(files):
|
||||
ti = append_root(tar.gettarinfo(filename))
|
||||
|
||||
# copy hardlinks as regular files
|
||||
|
||||
Reference in New Issue
Block a user