How does one get the size of a Docker image before they pull it to their machine?

How to do it for Nexus Docker repo like for docker hub?

Take a look at Retrieving Docker Image Sizes ยท GitHub. These instructions are not Nexus specific and will work for any registry which implements the Docker registry v2 API.