From here: https://gist.github.com/azu/376356adf1c56e0822584b0681d5a775
/var/lib/docker/image/overlay2/layerdb/sha256/<sha>
failed to register layer: rename <src> <dist>: file exists
Deleting the rubbish file in this <dist>
dir will cure the problem, but this file is in Docker, In Docker for macOS, you can delete it by going into Docker and forcibly rm it.
$ docker run -it --rm --privileged --pid=host alpine:edge nsenter -t 1 -m -u -n -i rm -rf /var/lib/docker/image/overlay2/layerdb/sha256/<sha>