If the content of layer.tar was sorted by filename, the compressed images created by the docker plugin would be reproducible.
This would permit distributions to build container images and use the sha256sum of the archive to determine if the docker-hub image is out of date.
For heavily git based workflows, a git commit -a would report no changes if the component files are actually the same.
Today, differences in the file order returned by readdir can result in differing archives with identical content.
Example workflow: https://fedoramagazine.org/building-fedora-rawhide-images-imagefactory/