'Get the digest image string for an image.
:type image: str
:param image: image id or image name and optionally, tag
:returns: digest string, having the format `<name>@<hash_alg>:<digest>`, e.g.:
`\'bgruening/docker-jupyter-notebook@sha256:3ec0bc9abc9d511aa602ee4fff2534d80dd9b1564482de52cb5de36cce6debae\'`
or, the original image name if the digest cannot be
determined (the image has not been pulled)'

def image_repodigest(self, image):

    try:
        inspect = self.image_inspect(image)
        return inspect[0]['RepoDigests'][0]
    except ContainerImageNotFound:
        return image
