code: def _get_docker_command(
      image,
      active_run,
      docker_args=None,
      volumes=None,
      user_env_vars=None,
  ):
      from mlflow.projects.docker import (
          get_docker_tracking_cmd_and_envs,
      )
  
      docker_path = "docker"
      cmd = [docker_path, "run", "--rm"]
  
      if docker_args:
          for name, value in docker_args.items():
              # Passed just the name as boolean flag
              if isinstance(value, bool) and value:
                  if len(name) == 1:
                      cmd += ["-" + name]
                  else:
                      cmd += ["--" + name]
              else:
                  # Passed name=value
                  if len(name) == 1:
                      cmd += ["-" + name, value]
                  else:
                      cmd += ["--" + name, value]
  
      env_vars = get_run_env_vars(
          run_id=active_run.info.run_id,
          experiment_id=active_run.info.experiment_id,
      )
      tracking_uri = tracking.get_tracking_uri()
      tracking_cmds, tracking_envs = get_docker_tracking_cmd_and_envs(
          tracking_uri
      )
      (
          artifact_cmds,
          artifact_envs,
      ) = _get_docker_artifact_storage_cmd_and_envs(
          active_run.info.artifact_uri
      )
  
      cmd += tracking_cmds + artifact_cmds
      env_vars.update(tracking_envs)
      env_vars.update(artifact_envs)
      if user_env_vars is not None:
          for user_entry in user_env_vars:
              if isinstance(user_entry, list):
                  # User has defined a new environment variable for the docker environment
                  env_vars[user_entry[0]] = user_entry[1]
              else:
                  # User wants to copy an environment variable from system environment
                  system_var = os.environ.get(user_entry)
                  if system_var is None:
                      raise MlflowException(
                          "This project expects the {} environment variables to "
                          "be set on the machine running the project, but {} was "
                          "not set. Please ensure all expected environment variables "
                          "are set".format(
                              ", ".join(user_env_vars), user_entry
                          )
                      )
                  env_vars[user_entry] = system_var
  
      if volumes is not None:
          for v in volumes:
              cmd += ["-v", v]
  
      for key, value in env_vars.items():
          cmd += ["-e", f"{key}={value}"]
      cmd += [image.tags[0]]
      return cmd
  
imports: import logging
  import os
  import platform
  import posixpath
  import subprocess
  import sys
  from pathlib import Path
  import mlflow
  from mlflow import tracking
  from mlflow.environment_variables import MLFLOW_KERBEROS_TICKET_CACHE, MLFLOW_KERBEROS_USER, MLFLOW_PYARROW_EXTRA_CONF
  from mlflow.exceptions import MlflowException
  from mlflow.projects import env_type
  from mlflow.projects.backend.abstract_backend import AbstractBackend
  from mlflow.projects.submitted_run import LocalSubmittedRun
  from mlflow.projects.utils import MLFLOW_DOCKER_WORKDIR_PATH, MLFLOW_LOCAL_BACKEND_RUN_ID_CONFIG, PROJECT_BUILD_IMAGE, PROJECT_DOCKER_ARGS, PROJECT_DOCKER_AUTH, PROJECT_ENV_MANAGER, PROJECT_STORAGE_DIR, PROJECT_SYNCHRONOUS, fetch_and_validate_project, get_entry_point_command, get_or_create_run, get_run_env_vars, load_project
  from mlflow.store.artifact.artifact_repository_registry import get_artifact_repository
  from mlflow.store.artifact.azure_blob_artifact_repo import AzureBlobArtifactRepository
  from mlflow.store.artifact.gcs_artifact_repo import GCSArtifactRepository
  from mlflow.store.artifact.hdfs_artifact_repo import HdfsArtifactRepository
  from mlflow.store.artifact.local_artifact_repo import LocalArtifactRepository
  from mlflow.store.artifact.s3_artifact_repo import S3ArtifactRepository
  from mlflow.utils import env_manager
  from mlflow.utils.conda import get_or_create_conda_env
  from mlflow.utils.databricks_utils import get_databricks_env_vars, is_in_databricks_runtime
  from mlflow.utils.environment import _PythonEnv
  from mlflow.utils.file_utils import get_or_create_nfs_tmp_dir
  from mlflow.utils.mlflow_tags import MLFLOW_PROJECT_ENV
  from mlflow.utils.virtualenv import _PYENV_ROOT_DIR, _VIRTUALENV_ENVS_DIR, _create_virtualenv, _get_mlflow_virtualenv_root, _get_virtualenv_extra_env_vars, _get_virtualenv_name, _install_python
label_desc: Use image node_id 6 for calling a global function with example usage: _get_docker_command(image, active_run, docker_args, volumes, user_env_vars) and returns: cmd