code: def generate_dockerfile(
      model_uri,
      output_directory,
      env_manager,
      mlflow_home,
      install_mlflow,
      enable_mlserver,
  ):
      """
      Generates a directory with Dockerfile whose default entrypoint serves an MLflow model at port
      8080 using the python_function flavor. The generated Dockerfile is written to the specified
      output directory, along with the model (if specified). This Dockerfile defines an image that
      is equivalent to the one produced by ``mlflow models build-docker``.
      """
      if model_uri:
          _logger.info("Generating Dockerfile for model %s", model_uri)
      else:
          _logger.info("Generating Dockerfile")
      backend = get_flavor_backend(
          model_uri, docker_build=True, env_manager=env_manager
      )
      if backend.can_build_image():
          backend.generate_dockerfile(
              model_uri,
              output_directory,
              mlflow_home=mlflow_home,
              install_mlflow=install_mlflow,
              enable_mlserver=enable_mlserver,
          )
          _logger.info(
              "Generated Dockerfile in directory %s", output_directory
          )
      else:
          _logger.error(
              "Cannot build docker image for selected backend",
              extra={"backend": backend.__class__.__name__},
          )
          raise NotImplementedError(
              "Cannot build docker image for selected backend"
          )
  
file_path: mlflow/mlflow/models/cli.py
imports: import logging
  import click
  from mlflow.models import python_api
  from mlflow.models.flavor_backend_registry import get_flavor_backend
  from mlflow.utils import cli_args
  from mlflow.utils import env_manager
label_desc: Use image node_id 5 for calling a global function with example usage: generate_dockerfile(model_uri, output_directory, env_manager, mlflow_home, install_mlflow, enable_mlserver) without return types