def get_repository_from_image(image):
    """ Returns the first RepoTag repository
    found in image. """

    repotags = image.attrs['RepoTags']
    for repotag in repotags:
        repository, tag = repotag.split(':')
        return repository