Re-use all the layers from cache for squashed case and commit as late as possible
Current implementation of marking for re-use of cache `commits` on every
`stage` when used with `--squashed` however we should try to re-use as
many layers are possible if `--layers` is specified and `commit` only on
`last instruction` of `last stage` to perform final squash.
Also treat all other layers as if they are being written for regular
build and write them cache.
Signed-off-by: Aditya Rajan <arajan@redhat.com>
When adding a hard link entry to an archive, don't try to make the path
of the link's target name be relative to the link's location in the
filesystem if they're in the same directory, since receivers don't
interpret it that way.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
If Squash is set, then we're only committing one layer, so if EmptyLayer
is set, which would normally tell us to skip committing the final layer,
we should ignore the EmptyLayer flag.
Signed-off-by: Nalin Dahyabhai <nalin@redhat.com>
Closes: #1839
Approved by: TomSweeneyRedHat