Latest answer
Edit suggested by OhJeez in the comments.
docker inspect --format="{{index .RepoDigests 0}}" $IMAGE
Original answer
I believe you can also get this using
docker inspect --format="{{.RepoDigests}}" $IMAGE
Works only in Docker 1.9 and if the image was originally pulled by the digest. Details are on the docker issue tracker.