Notably, all directories are present, even when a change is only to a file or is a whiteout.
To run locally:
$ sh explore.sh
The output will look like the following:
--------------------------------------------------------------------------
4436d46c103e44302f721ddced90aa0657ecc9f68714e63de2a0d2522519e98c/layer.tar (RUN /bin/sh -c mkdir /qux # buildkit)
--------------------------------------------------------------------------
etc/:
Type: directory
Mode: 040755
User: 0
Group: 0
Username:
Groupname:
Size: 0
qux/:
Type: directory
Mode: 040755
User: 0
Group: 0
Username:
Groupname:
Size: 0
--------------------------------------------------------------------------
b17faed57831ba8ef03c3670d10c7452a179d46ee045fd5c58f3301e9b9c09e5/layer.tar (WORKDIR /qux)
--------------------------------------------------------------------------
--------------------------------------------------------------------------
69e16878951fd7cb44c30814717425cbd5a74f68a0aacbdac44fec7d0f2dff1d/layer.tar (RUN /bin/sh -c touch foo # buildkit)
--------------------------------------------------------------------------
etc/:
Type: directory
Mode: 040755
User: 0
Group: 0
Username:
Groupname:
Size: 0
qux/:
Type: directory
Mode: 040755
User: 0
Group: 0
Username:
Groupname:
Size: 0
qux/foo:
Type: regular file
Mode: 0100644
User: 0
Group: 0
Username:
Groupname:
Size: 0
--------------------------------------------------------------------------
8637760c70e1dc8955b1282c7338a1c07bfc41697429ea82fbdfd2003af17878/layer.tar (RUN /bin/sh -c echo bar > foo # buildkit)
--------------------------------------------------------------------------
etc/:
Type: directory
Mode: 040755
User: 0
Group: 0
Username:
Groupname:
Size: 0
qux/:
Type: directory
Mode: 040755
User: 0
Group: 0
Username:
Groupname:
Size: 0
qux/foo:
Type: regular file
Mode: 0100644
User: 0
Group: 0
Username:
Groupname:
Size: 4
--------------------------------------------------------------------------
d8adc6ae8d990e2fcf26be6352daf20f5817a559ec55241c56e2958cd6ee81f2/layer.tar (RUN /bin/sh -c rm foo # buildkit)
--------------------------------------------------------------------------
etc/:
Type: directory
Mode: 040755
User: 0
Group: 0
Username:
Groupname:
Size: 0
qux/:
Type: directory
Mode: 040755
User: 0
Group: 0
Username:
Groupname:
Size: 0
qux/.wh.foo:
Type: regular file
Mode: 0600
User: 0
Group: 0
Username:
Groupname:
Size: 0