FLAMEDockerBackend (flame_docker_backend v0.1.0)

Copy Markdown View Source

Docker-out-of-Docker backend for FLAME.

The parent runs inside a container and provisions runners via the Docker Engine API through a mounted socket. Runners join the same user-defined network as the parent.

Required configuration

config :flame, FLAMEDockerBackend,
  image: "my-app:latest",
  network: "my_network"

The parent container must use a distributed release, a stable --name on the Docker network, and the Docker socket mounted. See the project README for deployment details.

Optional configuration

  • :env — extra runner env vars (PHX_SERVER may be overridden; FLAME_PARENT may not)
  • :host_config, :mounts, :cmd — Docker create payload passthrough
  • :docker_socket_path — path to the Docker socket (auto-detected when omitted)
  • :boot_timeout — boot wait in ms (default 30_000)
  • :keep_runners — when true, leave runner containers after exit for log inspection (default false, containers are removed)
  • :runner_hostname_env — env var for runner hostname (default "HOSTNAME")
  • :parent_hostname — override parent Erlang hostname (defaults to current node host)

Per-pool overrides:

{FLAME.Pool, name: MyRunner, backend: {FLAMEDockerBackend, image: "...", network: "..."}}

Summary

Types

t()

@type t() :: %FLAMEDockerBackend{
  app: String.t(),
  boot_timeout: pos_integer(),
  cmd: [String.t()] | nil,
  docker_socket_path: String.t() | nil,
  env: map(),
  host_config: map() | nil,
  image: String.t(),
  keep_runners: boolean(),
  mounts: list() | nil,
  network: String.t(),
  parent_hostname: String.t(),
  parent_ref: reference() | nil,
  remote_terminator_pid: pid() | nil,
  runner_container_id: String.t() | nil,
  runner_hostname_env: String.t(),
  runner_node_base: String.t() | nil,
  runner_node_name: node() | nil
}