def get_container_image_name(container_name):
    cmd = ("docker inspect --format '{{.Config.Image}}' " + container_name)
    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, text=True)
    (out, _) = proc.communicate()
    if (proc.returncode != 0):
        sys.exit(proc.returncode)
    image_latest = out.rstrip()
    cmd = (('echo ' + image_latest) + " | cut -d ':' -f 1")
    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, text=True)
    image_name = proc.stdout.read().rstrip()
    return image_name
def get_container_image_name(container_name):
    cmd = ("docker inspect --format '{{.Config.Image}}' " + container_name)
    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, text=True)
    (out, _) = proc.communicate()
    if (proc.returncode != 0):
        sys.exit(proc.returncode)
    image_latest = out.rstrip()
    cmd = (('echo ' + image_latest) + " | cut -d ':' -f 1")
    proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, shell=True, text=True)
    image_name = proc.stdout.read().rstrip()
    return image_name