def METHOD_NAME(
    dockerfile_path: Path,
    workdir: Path,
    tags: t.List[str],
    platforms: t.List[str],
    push: bool = False,
    dry_run: bool = False,
    use_starwhale_builder: bool = False,
) -> None:
    if not tags:
        raise MissingFieldError(
            "buildx must contain at least one or more tag parameter"
        )
    cmd = [
        "docker",
        "buildx",
        "build",
        "--network",
        "host",
        "--pull",
        "--progress",
        "plain",
    ]
    if use_starwhale_builder:
        create_builder(dry_run)
        cmd += ["--builder", BUILDER_NAME]
    for _p in platforms:
        # TODO: add multiarch/qemu-user-static reset for non-amd64 arch
        if _p not in BUILDX_ARCH_MAP:
            raise NoSupportError(f"Starwhale base image {_p} arch")
        cmd += ["--platform", BUILDX_ARCH_MAP[_p]]
    for _t in tags:
        _t = _t.strip()
        if not _t:
            continue
        cmd += ["--tag", _t]
    if push:
        cmd += ["--push"]
    else:
        cmd += ["--load"]
    cmd += ["--file", str(dockerfile_path.absolute()), str(workdir.absolute())]
    if dry_run:
        console.print(":panda_face: buildx build command:")
        console.print(f"\t [bold red]{' '.join(cmd)}[/]")
    else:
        console.print(":panda_face: start to build image with buildx...")
        check_call(cmd, log=console.print, env=_BUILDX_CMD_ENV)