How to get the image digest by image name & tag

I am trying to get the digest of a docker image which I have built and pushed to a private repository.
How can I get the digest by image-name:tag using a bash command?
I tried this command:

docker images --format "{{.Digest}}" --filter reference=${registry}/${image-name}:${tag}

but it doesn’t return what I would like to get, e.g. just the digest of the ${registry}/${image-name}:${tag} image.
Any help with this?

Source: Docker Questions