Merge pull request #88762 from alexbiehl/alex/docker-tools

dockerTools: Properly add /nix/ and /nix/store/ first to layer.tar
This commit is contained in:
Shea Levy 2020-05-24 08:34:42 -04:00 committed by GitHub
commit fffa6e8c18
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -30,12 +30,13 @@ mkdir -p nix/store
# store path to the absolute store path.
tarhash=$(
basename -a "$@" |
tar -cp nix \
-C /nix/store --verbatim-files-from --files-from - \
tar --create --preserve-permissions --absolute-names nix \
--directory /nix/store --verbatim-files-from --files-from - \
--hard-dereference --sort=name \
--mtime="@$SOURCE_DATE_EPOCH" \
--owner=0 --group=0 \
--transform 's,^nix(/|$),/nix/,' \
--transform 's,^nix$,/\0,' \
--transform 's,^nix/store$,/\0,' \
--transform 's,^[^/],/nix/store/\0,rS' |
tee "$layerPath/layer.tar" |
tarsum