code: def prepare_docker_build_cache_command(
      image_params: CommonBuildParams,
  ) -> list[str]:
      """
      Constructs docker build_cache command based on the parameters passed.
      :param image_params: parameters of the image
  
  
      :return: Command to run as list of string
      """
      final_command = []
      final_command.extend(["docker"])
      final_command.extend(
          [
              "buildx",
              "build",
              "--builder",
              get_and_use_docker_context(image_params.builder),
              "--progress=auto",
          ]
      )
      final_command.extend(image_params.common_docker_build_flags)
      final_command.extend(["--pull"])
      final_command.extend(
          image_params.prepare_arguments_for_docker_build_command()
      )
      final_command.extend(["--target", "main", "."])
      final_command.extend(
          [
              "-f",
              "Dockerfile"
              if isinstance(image_params, BuildProdParams)
              else "Dockerfile.ci",
          ]
      )
      final_command.extend(["--platform", image_params.platform])
      final_command.extend(
          [
              f"--cache-to=type=registry,ref={image_params.get_cache(image_params.platform)},mode=max"
          ]
      )
      return final_command
  
imports: from __future__ import annotations
  import copy
  import json
  import os
  import re
  import sys
  from subprocess import DEVNULL, CalledProcessError, CompletedProcess
  from typing import TYPE_CHECKING
  from airflow_breeze.params.build_prod_params import BuildProdParams
  from airflow_breeze.utils.cache import read_from_cache_file
  from airflow_breeze.utils.host_info_utils import get_host_group_id, get_host_os, get_host_user_id
  from airflow_breeze.utils.path_utils import AIRFLOW_SOURCES_ROOT, SCRIPTS_DOCKER_DIR, cleanup_python_generated_files, create_mypy_volume_if_needed
  from airflow_breeze.utils.shared_options import get_verbose
  from airflow_breeze.utils.visuals import ASCIIART, ASCIIART_STYLE, CHEATSHEET, CHEATSHEET_STYLE
  from airflow_breeze.global_constants import ALLOWED_CELERY_BROKERS, ALLOWED_DEBIAN_VERSIONS, DEFAULT_PYTHON_MAJOR_MINOR_VERSION, DOCKER_DEFAULT_PLATFORM, MIN_DOCKER_COMPOSE_VERSION, MIN_DOCKER_VERSION, SEQUENTIAL_EXECUTOR
  from airflow_breeze.utils.console import Output, get_console
  from airflow_breeze.utils.run_utils import RunCommandResult, check_if_buildx_plugin_installed, run_command
label_desc: Use image node_id 8 for calling a global function with example usage: prepare_docker_build_cache_command(image_params) and returns: final_command