dockerTools.buildLayeredImage: restore layer sharing
PR #58431 added /nix/store to each layer.tar. However, the timestamp was not explicitly set while adding /nix and /nix/store to the archive. This resulted in different SHA256 hashes of layer.tar between image builds. This change sets time and owner when tar'ing /nix/store.
This commit is contained in:
parent
8b3d0b00d5
commit
d7f3186b48
@ -9,7 +9,9 @@ layerPath="./layers/$layerNumber"
|
|||||||
echo "Creating layer #$layerNumber for $@"
|
echo "Creating layer #$layerNumber for $@"
|
||||||
|
|
||||||
mkdir -p "$layerPath"
|
mkdir -p "$layerPath"
|
||||||
tar --no-recursion -rf "$layerPath/layer.tar" /nix /nix/store
|
tar --no-recursion -rf "$layerPath/layer.tar" \
|
||||||
|
--mtime="@$SOURCE_DATE_EPOCH" \
|
||||||
|
--owner=0 --group=0 /nix /nix/store
|
||||||
tar -rpf "$layerPath/layer.tar" --hard-dereference --sort=name \
|
tar -rpf "$layerPath/layer.tar" --hard-dereference --sort=name \
|
||||||
--mtime="@$SOURCE_DATE_EPOCH" \
|
--mtime="@$SOURCE_DATE_EPOCH" \
|
||||||
--owner=0 --group=0 "$@"
|
--owner=0 --group=0 "$@"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user