IComposeEngine over the docker compose CLI. Argv construction and output
parsing are pure; the process runs through an injected exec with
hive-system's shell.core/exec! contract (argv, opts) -> Result.
Secret references in a profile's env are read only by the calls that create
containers (up, a recreating restart), through the injected resolver
(see hive-compose.adapter.secrets). Every other call is given their
renderings, so it interpolates and reads no store.
IComposeEngine over the docker compose CLI. Argv construction and output parsing are pure; the process runs through an injected `exec` with hive-system's `shell.core/exec!` contract (argv, opts) -> Result. Secret references in a profile's env are read only by the calls that create containers (`up`, a recreating `restart`), through the injected resolver (see `hive-compose.adapter.secrets`). Every other call is given their renderings, so it interpolates and reads no store.
(already-attached? stderr)True when docker refused a network connect because the container is
already on the network.
True when docker refused a `network connect` because the container is already on the network.
(base-argv p)docker compose addressed at profile p: project dir, project name, files
and native compose profiles.
`docker compose` addressed at profile `p`: project dir, project name, files and native compose profiles.
(closure-services s)Sorted services of a config --format json document.
Sorted services of a `config --format json` document.
The files compose reads when given no -f, in its own order (one list, in
hive-compose.promote.config, which the read-path preflight shares).
The files compose reads when given no -f, in its own order (one list, in `hive-compose.promote.config`, which the read-path preflight shares).
(container-addresses rows)#{ip} of docker inspect rows: the IPv4 and global IPv6 address each
running container holds on each of its networks.
#{ip} of `docker inspect` rows: the IPv4 and global IPv6 address each
running container holds on each of its networks.(container-ids-argv p)Every container of p's compose project, running or not, by label, one
<id> <service> line each. Loads no compose file.
Every container of `p`'s compose project, running or not, by label, one `<id> <service>` line each. Loads no compose file.
(container-names s services)Sorted names of the containers of services in containers-argv output.
Sorted names of the containers of `services` in `containers-argv` output.
(container-services s){name service} of containers-argv output.
{name service} of `containers-argv` output.
(containers-argv p)Every container of p's compose project, running or not, found by its
compose labels, one <name> <service> line each. Loads no compose file.
Every container of `p`'s compose project, running or not, found by its compose labels, one `<name> <service>` line each. Loads no compose file.
(cpu-percent s)The number in a docker stats CPU column ("12.5%"), nil when there is
none ("--" for a container that just stopped).
The number in a `docker stats` CPU column ("12.5%"), nil when there is
none ("--" for a container that just stopped).(default-file exists?)The first of compose-default-files for which exists? is true, in
compose's own order; nil when none. Pure over the probe.
The first of `compose-default-files` for which `exists?` is true, in compose's own order; nil when none. Pure over the probe.
(dependency-graph s){service {dep {:required? bool}}} of a config --format json document.
Map-form depends_on reads each entry's "required" (absent = true);
list-form depends_on makes every entry required.
{service {dep {:required? bool}}} of a `config --format json` document.
Map-form depends_on reads each entry's "required" (absent = true);
list-form depends_on makes every entry required.(down-project-argv spec override)Remove the containers of spec's services, or with :all? the whole
project and its own networks. Never -v.
Remove the containers of `spec`'s services, or with `:all?` the whole project and its own networks. Never `-v`.
(health-of status)The health in a docker Status column: "Up 2 minutes (healthy)" ->
:healthy, "(unhealthy)" -> :unhealthy, "(health: starting)" -> :starting,
anything else :none (no healthcheck).
The health in a docker `Status` column: "Up 2 minutes (healthy)" -> :healthy, "(unhealthy)" -> :unhealthy, "(health: starting)" -> :starting, anything else :none (no healthcheck).
(ids-argv p)The ids of the running containers of p's project.
The ids of the running containers of `p`'s project.
(label-args labels)--label k=v pairs of labels, sorted by key.
`--label k=v` pairs of `labels`, sorted by key.
(label-filter-args labels)--filter label=k=v pairs of labels, sorted by key.
`--filter label=k=v` pairs of `labels`, sorted by key.
(labelled-containers s)Rows of labelled-containers-argv output: {:name :project :service
:labels :state :health}, sorted by name.
Rows of `labelled-containers-argv` output: {:name :project :service
:labels :state :health}, sorted by name.(labelled-containers-argv labels)Every container, running or not, carrying all labels, one JSON object a line.
Every container, running or not, carrying all `labels`, one JSON object a line.
(labelled-networks s)Rows of labelled-networks-argv output: {:name :labels}, sorted by name.
Rows of `labelled-networks-argv` output: {:name :labels}, sorted by name.
(labelled-networks-argv labels)Every network carrying all labels, one JSON object a line.
Every network carrying all `labels`, one JSON object a line.
Full ids of every running container the daemon knows, any project.
Full ids of every running container the daemon knows, any project.
(logs-argv p services tail)compose logs of services (all when empty), the last tail lines each;
with :profile/timestamps? every line carries docker's RFC 3339 time, so
a time window can be cut from it (hc-10 why).
`compose logs` of `services` (all when empty), the last `tail` lines each; with `:profile/timestamps?` every line carries docker's RFC 3339 time, so a time window can be cut from it (hc-10 why).
(make-engine opts)CliEngine. opts: :exec (default hive-system shell.core/exec!),
:compose/resolver ({scheme ISecretBackend}, default the pass one over
that exec), :compose/timeout-ms, :compose/up-timeout-ms,
:compose/stack-dir (where stack overrides go, default stack-dir).
CliEngine. `opts`: :exec (default hive-system `shell.core/exec!`),
:compose/resolver ({scheme ISecretBackend}, default the `pass` one over
that exec), :compose/timeout-ms, :compose/up-timeout-ms,
:compose/stack-dir (where stack overrides go, default `stack-dir`).(network-connect-argv network container aliases)docker network connect of container to network under every alias.
`docker network connect` of `container` to `network` under every alias.
(network-containers-argv network)The containers attached to network, one name per line.
The containers attached to `network`, one name per line.
(network-ls-argv network)The network named exactly network, its name on one line when present.
The network named exactly `network`, its name on one line when present.
(override-doc {:keys [services labels networks container-env
service-overrides]})The compose override of ProjectSpec spec as data: each of its
:services gets :labels, joins the external :networks (its project's
default network is then left out, so names resolve on those networks
alone; networks a service declares in its own files stay) and receives the
variables :container-env names, as null so compose reads their values
from its own environment. :service-overrides ({service {key value}},
hc-16a resource caps: mem_limit, cpus, environment {VAR value}) is
merged into the entry of each service it names, environment per
variable; a service it names that :services does not is added. Pure.
The compose override of ProjectSpec `spec` as data: each of its
`:services` gets `:labels`, joins the external `:networks` (its project's
default network is then left out, so names resolve on those networks
alone; networks a service declares in its own files stay) and receives the
variables `:container-env` names, as null so compose reads their values
from its own environment. `:service-overrides` ({service {key value}},
hc-16a resource caps: mem_limit, cpus, environment {VAR value}) is
merged into the entry of each service it names, environment per
variable; a service it names that `:services` does not is added. Pure.(override-json spec)override-doc of spec as JSON text.
`override-doc` of `spec` as JSON text.
(override-path dir project)Where the override of compose project project is written under dir.
Where the override of compose project `project` is written under `dir`.
(override? spec)True when ProjectSpec spec needs a generated override file.
True when ProjectSpec `spec` needs a generated override file.
(parse-json-rows s)Rows of compose --format json output, which is a JSON array or one JSON
object per line depending on the compose version.
Rows of compose `--format json` output, which is a JSON array or one JSON object per line depending on the compose version.
(parse-labels s){k v} of docker's Labels column, "k=v,k2=v2". A value holding a comma
is cut there: docker joins with no escape.
{k v} of docker's `Labels` column, "k=v,k2=v2". A value holding a comma
is cut there: docker joins with no escape.(project-argv spec override)docker compose addressed at ProjectSpec spec, override (a path, or
nil) as the last -f.
`docker compose` addressed at ProjectSpec `spec`, `override` (a path, or nil) as the last `-f`.
(projects rows)Project summaries of ls rows.
Project summaries of `ls` rows.
(published-ports rows){service #{host-port}} of the running containers in ps rows: the
PublishedPort of each of their Publishers that publishes one.
{service #{host-port}} of the running containers in `ps` rows: the
PublishedPort of each of their Publishers that publishes one.(restart-argv p services recreate?)compose restart of services, or when recreate? an up -d --force-recreate --no-deps of exactly them: their dependencies are left
as they are.
`compose restart` of `services`, or when `recreate?` an `up -d --force-recreate --no-deps` of exactly them: their dependencies are left as they are.
(rm-containers-argv names)docker rm of stopped container names: their anonymous volumes stay.
`docker rm` of stopped container `names`: their anonymous volumes stay.
(running-containers-argv p)The running containers of p's compose project, as containers-argv.
The running containers of `p`'s compose project, as `containers-argv`.
(running-services rows)Sorted set of services with a running container in ps rows.
Sorted set of services with a running container in `ps` rows.
(service-container-ids s services){service id} of container-ids-argv output for services. Pure.
{service id} of `container-ids-argv` output for `services`. Pure.
(service-containers-argv project service)Every container of service in compose project project, running or not,
one name per line. Loads no compose file.
Every container of `service` in compose project `project`, running or not, one name per line. Loads no compose file.
(service-cpu names s){service percent} of stats-argv output s for containers names
({name service}): the busiest container of each service. A container
whose reading is no number is left out.
{service percent} of `stats-argv` output `s` for containers `names`
({name service}): the busiest container of each service. A container
whose reading is no number is left out.(service-facts s services){service {:image :java-tool-options :mem-limit}} of services in a
config --format json document: the image each runs, the
JAVA_TOOL_OPTIONS its file sets (environment as a map or a list of
VAR=value) and its own memory limit (mem_limit or
deploy.resources.limits.memory), when set. Pure.
{service {:image :java-tool-options :mem-limit}} of `services` in a
`config --format json` document: the image each runs, the
JAVA_TOOL_OPTIONS its file sets (environment as a map or a list of
VAR=value) and its own memory limit (mem_limit or
deploy.resources.limits.memory), when set. Pure.(service-resources s services){:volumes #{name} :ports #{port}} of services in a config --format json
document: the real names of the named volumes they mount (the top-level
volumes entry's name, else the key) and the host ports they publish.
Pure.
{:volumes #{name} :ports #{port}} of `services` in a `config --format json`
document: the real names of the named volumes they mount (the top-level
`volumes` entry's name, else the key) and the host ports they publish.
Pure.(stack-dir opts)Where stack overrides are written: stacks/ beside the state file, else
under the temp dir.
Where stack overrides are written: `stacks/` beside the state file, else under the temp dir.
(stats-argv names)One docker stats sample of container names, one <name> <cpu%> line each.
One `docker stats` sample of container `names`, one `<name> <cpu%>` line each.
(stop-containers-argv names)docker stop of container names.
`docker stop` of container `names`.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |