This script can help you save time from downloading/rebuild docker images when you want to use Factory Reset or Resize Disk Image in Docker for Mac which deletes all local images.
If you have Time Machine enabled, You can use this command to free up a significant amount of disk space:
tmutil thinlocalsnapshots / 10000 4
For me, I have around 30 images on my dev machine which takes around 25GB
on-disk space to backup.