Merge pull request #58431 from alexbiehl/alex/nix-layers
dockerTools: align generated layer archives with docker's output
This commit is contained in:
commit
6af317616e
2 changed files with 2 additions and 1 deletions
|
@ -344,7 +344,7 @@ rec {
|
|||
# Tar up the layer and throw it into 'layer.tar'.
|
||||
echo "Packing layer..."
|
||||
mkdir $out
|
||||
tar -C layer --sort=name --mtime="@$SOURCE_DATE_EPOCH" --owner=${toString uid} --group=${toString gid} -cf $out/layer.tar .
|
||||
tar --transform='s|^\./||' -C layer --sort=name --mtime="@$SOURCE_DATE_EPOCH" --owner=${toString uid} --group=${toString gid} -cf $out/layer.tar .
|
||||
|
||||
# Compute a checksum of the tarball.
|
||||
echo "Computing layer checksum..."
|
||||
|
|
|
@ -9,6 +9,7 @@ layerPath="./layers/$layerNumber"
|
|||
echo "Creating layer #$layerNumber for $@"
|
||||
|
||||
mkdir -p "$layerPath"
|
||||
tar --no-recursion -rf "$layerPath/layer.tar" /nix /nix/store
|
||||
tar -rpf "$layerPath/layer.tar" --hard-dereference --sort=name \
|
||||
--mtime="@$SOURCE_DATE_EPOCH" \
|
||||
--owner=0 --group=0 "$@"
|
||||
|
|
Loading…
Reference in a new issue