code: def docker_run(
      obj,
      image,
      command,
      *,
      env,
      user,
      force_pull,
      force_build,
      build_only,
      using_docker_cli,
      using_docker_buildx,
      use_cache,
      use_leaf_cache,
      resource_limit,
      volume,
  ):
      """
      Execute docker-compose builds.
  
      To see the available builds run `archery docker images`.
  
      Examples:
  
      # execute a single build
      archery docker run conda-python
  
      # execute the builds but disable the image pulling
      archery docker run --no-cache conda-python
  
      # pass a docker-compose parameter, like the python version
      PYTHON=3.8 archery docker run conda-python
  
      # disable the cache only for the leaf image
      PANDAS=upstream_devel archery docker run --no-leaf-cache \
          conda-python-pandas
  
      # entirely skip building the image
      archery docker run --no-pull --no-build conda-python
  
      # pass runtime parameters via docker environment variables
      archery docker run -e CMAKE_BUILD_TYPE=release ubuntu-cpp
  
      # set a volume
      archery docker run -v $PWD/build:/build ubuntu-cpp
  
      # starting an interactive bash session for debugging
      archery docker run ubuntu-cpp bash
      """
      compose = obj["compose"]
      using_docker_cli |= using_docker_buildx
  
      env = dict(kv.split("=", 1) for kv in env)
      try:
          if force_pull:
              compose.pull(
                  image,
                  pull_leaf=use_leaf_cache,
                  using_docker=using_docker_cli,
              )
          if force_build:
              compose.build(
                  image,
                  use_cache=use_cache,
                  use_leaf_cache=use_leaf_cache,
                  using_docker=using_docker_cli,
                  using_buildx=using_docker_buildx,
              )
          if build_only:
              return
          compose.run(
              image,
              command=command,
              env=env,
              user=user,
              using_docker=using_docker_cli,
              resource_limit=resource_limit,
              volumes=volume,
          )
      except UndefinedImage as e:
          raise click.ClickException(
              "There is no service/image defined in docker-compose.yml with "
              "name: {}".format(str(e))
          )
      except RuntimeError as e:
          raise click.ClickException(str(e))
  
file_path: arrow/dev/archery/archery/docker/cli.py
imports: import os
  import sys
  import click
  from ..utils.cli import validate_arrow_sources
  from .core import DockerCompose, UndefinedImage
label_desc: Use image node_id 6 for calling a global function with example usage: docker_run(obj, image, command) without return types