code: def _build_image(
      image_name,
      entrypoint,
      env_manager,
      mlflow_home=None,
      custom_setup_steps_hook=None,
  ):
      """
      Build an MLflow Docker image that can be used to serve a
      The image is built locally and it requires Docker to run.
  
      :param image_name: Docker image name.
      :param entry_point: String containing ENTRYPOINT directive for docker image
      :param env_manager: Environment manager to create a model environment for serving.
      :param mlflow_home: (Optional) Path to a local copy of the MLflow GitHub repository.
                          If specified, the image will install MLflow from this directory.
                          If None, it will install MLflow from pip.
      :param custom_setup_steps_hook: (Optional) Single-argument function that takes the string path
             of a dockerfile context directory and returns a string containing Dockerfile commands to
             run during the image build step.
      """
      mlflow_home = (
          os.path.abspath(mlflow_home) if mlflow_home else None
      )
  
      is_conda = env_manager == em.CONDA
      setup_miniconda = SETUP_MINICONDA if is_conda else ""
      setup_pyenv_and_virtualenv = (
          "" if is_conda else SETUP_PYENV_AND_VIRTUALENV
      )
  
      with TempDir() as tmp:
          cwd = tmp.path()
          install_mlflow = _get_mlflow_install_step(cwd, mlflow_home)
          custom_setup_steps = (
              custom_setup_steps_hook(cwd)
              if custom_setup_steps_hook
              else ""
          )
          with open(os.path.join(cwd, "Dockerfile"), "w") as f:
              f.write(
                  _generate_dockerfile_content(
                      setup_miniconda=setup_miniconda,
                      setup_pyenv_and_virtualenv=setup_pyenv_and_virtualenv,
                      install_mlflow=install_mlflow,
                      custom_setup_steps=custom_setup_steps,
                      entrypoint=entrypoint,
                  )
              )
          _logger.info("Building docker image with name %s", image_name)
          _build_image_from_context(
              context_dir=cwd, image_name=image_name
          )
  
file_path: mlflow/mlflow/models/docker_utils.py
imports: import logging
  import os
  from subprocess import PIPE, STDOUT, Popen
  from urllib.parse import urlparse
  from mlflow.utils import env_manager
  from mlflow.utils.file_utils import TempDir, _copy_project
  from mlflow.utils.logging_utils import eprint
  from mlflow.version import VERSION
label_desc: Use image node_id 4 for calling a global function with example usage: _build_image(image_name, entrypoint, env_manager, mlflow_home, custom_setup_steps_hook) without return types