def build()

in build_docker.py [0:0]


def build(framework: str, is_gpu: bool):
    DEFAULT_HOSTNAME = os.getenv("DEFAULT_HOSTNAME")
    hostname = DEFAULT_HOSTNAME
    tag_id = str(uuid.uuid4())[:5]
    tag = f"{framework}-{tag_id}"
    container_tag = f"{hostname}/api-inference/community:{tag}"

    command = ["docker", "build", f"docker_images/{framework}", "-t", container_tag]
    run(command)

    password = os.environ["REGISTRY_PASSWORD"]
    username = os.environ["REGISTRY_USERNAME"]
    command = ["echo", password]
    ecr_login = subprocess.Popen(command, stdout=subprocess.PIPE)
    docker_login = subprocess.Popen(
        ["docker", "login", "-u", username, "--password-stdin", hostname],
        stdin=ecr_login.stdout,
        stdout=subprocess.PIPE,
    )
    docker_login.communicate()

    command = ["docker", "push", container_tag]
    run(command)
    return tag