Repository size

I have a question, I have a repository on Docker Hub that is 42.7 GB, how do I reduce the size? I wanted to create a script to do this automatically, do I have to delete the tags?

See related post. Docker should make a tool available soon to clean up a Docker repository.