def METHOD_NAME(name: str, dockerfile: str) -> kfp.dsl.ContainerOp:
    task: kfp.dsl.ContainerOp = kaniko(
        context_artifact=download_src_op.outputs['folder'],
        destination=f'{image_registry}/{name}',
        dockerfile=dockerfile,
    )
    # CPU request/limit can be more flexible (request < limit), because being assigned to a node
    # with insufficient CPU resource will only slow the task down, but not fail.
    task.container.set_cpu_request('1').set_cpu_limit('2')
    # Memory request/limit needs to be more rigid (request == limit), because in a node without
    # enough memory, the task can hang indefinetely or OOM.
    task.container.set_memory_request('4Gi').set_memory_limit('4Gi')
    task.set_display_name(f'build-image-{name}')
    task.set_retry(
        1, policy='Always'
    )  # Always -> retry on both system error and user code failure.
    return task