run_docker_command#

run_docker_command(client: DockerClient, image: str, command: list[str], volume: str | None = None, environment: list | None = None, *, detach: bool) None[source]#

Run container from image with given command.

Parameters:
  • client – Docker API client.

  • image – Docker image.

  • command – Command list passed to container.

  • volume – Name of the docker volume.

  • environment – List of environment variables as strings.

  • detach – True to start container and immediately return the Container object, False otherwise.