Ensure the layer IDs in legacy docker/tarfile metadata are unique
Ensure the layer IDs in legacy docker/tarfile metadata are unique

Duplicate IDs would otherwise result in duplicate files in the tarball,
with some of the versions possibly causing an import loop.

Duplicate layer IDs can happen
- using layer-at-a-time editing tools
- naively by accident, e.g.
  > FROM fedora
  >
  > ADD empty /
  > RUN rm /empty
  > ADD empty /
  creates two identical layers
- by a malicious actor

Signed-off-by: Miloslav Trmač <9c008e38982a5397deb855345fb164f0558459ae@redhat.com>

containers/image,containers/image