Liking cljdoc? Tell your friends :D

hive-compose.adapter.cli

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.
raw docstring

already-attached?clj

(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.
sourceraw docstring

base-argvclj

(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.
sourceraw docstring

closure-argvclj

(closure-argv p)
source

closure-servicesclj

(closure-services s)

Sorted services of a config --format json document.

Sorted services of a `config --format json` document.
sourceraw docstring

compose-default-filesclj

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).
sourceraw docstring

container-addressesclj

(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.
sourceraw docstring

container-ids-argvclj

(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.
sourceraw docstring

container-namesclj

(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.
sourceraw docstring

container-servicesclj

(container-services s)

{name service} of containers-argv output.

{name service} of `containers-argv` output.
sourceraw docstring

containers-argvclj

(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.
sourceraw docstring

cpu-percentclj

(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).
sourceraw docstring

default-fileclj

(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.
sourceraw docstring

dependency-graphclj

(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.
sourceraw docstring

down-argvclj

(down-argv p services)
source

down-project-argvclj

(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`.
sourceraw docstring

health-ofclj

(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).
sourceraw docstring

ids-argvclj

(ids-argv p)

The ids of the running containers of p's project.

The ids of the running containers of `p`'s project.
sourceraw docstring

inspect-argvclj

(inspect-argv ids)
source

label-argsclj

(label-args labels)

--label k=v pairs of labels, sorted by key.

`--label k=v` pairs of `labels`, sorted by key.
sourceraw docstring

label-filter-argsclj

(label-filter-args labels)

--filter label=k=v pairs of labels, sorted by key.

`--filter label=k=v` pairs of `labels`, sorted by key.
sourceraw docstring

labelled-containersclj

(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.
sourceraw docstring

labelled-containers-argvclj

(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.
sourceraw docstring

labelled-networksclj

(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.
sourceraw docstring

labelled-networks-argvclj

(labelled-networks-argv labels)

Every network carrying all labels, one JSON object a line.

Every network carrying all `labels`, one JSON object a line.
sourceraw docstring

linesclj

(lines s)

Non-blank trimmed lines of s.

Non-blank trimmed lines of `s`.
sourceraw docstring

listed-argvclj

(listed-argv p)
source

live-ids-argvclj

Full ids of every running container the daemon knows, any project.

Full ids of every running container the daemon knows, any project.
sourceraw docstring

logs-argvclj

(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).
sourceraw docstring

ls-argvclj

source

make-engineclj

(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`).
sourceraw docstring

network-connect-argvclj

(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.
sourceraw docstring

network-containers-argvclj

(network-containers-argv network)

The containers attached to network, one name per line.

The containers attached to `network`, one name per line.
sourceraw docstring

network-create-argvclj

(network-create-argv network labels)
source

network-disconnect-argvclj

(network-disconnect-argv network container)
source

network-ls-argvclj

(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.
sourceraw docstring

network-rm-argvclj

(network-rm-argv network)
source

override-docclj

(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.
sourceraw docstring

override-jsonclj

(override-json spec)

override-doc of spec as JSON text.

`override-doc` of `spec` as JSON text.
sourceraw docstring

override-pathclj

(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`.
sourceraw docstring

override?clj

(override? spec)

True when ProjectSpec spec needs a generated override file.

True when ProjectSpec `spec` needs a generated override file.
sourceraw docstring

parse-json-rowsclj

(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.
sourceraw docstring

parse-labelsclj

(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.
sourceraw docstring

profiles-argvclj

(profiles-argv p)
source

project-argvclj

(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`.
sourceraw docstring

projectsclj

(projects rows)

Project summaries of ls rows.

Project summaries of `ls` rows.
sourceraw docstring

ps-argvclj

(ps-argv p)
source

published-portsclj

(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.
sourceraw docstring

restart-argvclj

(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.
sourceraw docstring

rm-containers-argvclj

(rm-containers-argv names)

docker rm of stopped container names: their anonymous volumes stay.

`docker rm` of stopped container `names`: their anonymous volumes stay.
sourceraw docstring

running-containers-argvclj

(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`.
sourceraw docstring

running-servicesclj

(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.
sourceraw docstring

service-container-idsclj

(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.
sourceraw docstring

service-containers-argvclj

(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.
sourceraw docstring

service-cpuclj

(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.
sourceraw docstring

service-factsclj

(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.
sourceraw docstring

service-resourcesclj

(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.
sourceraw docstring

stack-dirclj

(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.
sourceraw docstring

stats-argvclj

(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.
sourceraw docstring

stop-argvclj

(stop-argv p services)
source

stop-containers-argvclj

(stop-containers-argv names)

docker stop of container names.

`docker stop` of container `names`.
sourceraw docstring

up-argvclj

(up-argv p services)
source

up-project-argvclj

(up-project-argv spec override)
source

version-argvclj

source

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
←Move to previous article
→Move to next article
Ctrl+/Jump to the search field
× close