Skip to main content

Compose Key Reference

This page lists what Docker Compose keys become in a configuration, and every key of the x-admrl extension. Each warning and error names the compose path it refers to, for example services.db.healthcheck.interval.

Some keys need a feature of the device agent. The feature is listed so you know what a device must report before it accepts the configuration. See Agent features.

Service keys that are mapped​

Compose keyBecomesNotes
imageimageRequired.
entrypointcommandentrypoint and command together become one argv. Setting an entrypoint clears the image CMD, as in Docker. An empty entrypoint with no command is an error.
command (alone)argsReplaces the image CMD and keeps the image ENTRYPOINT. Needs process.args.
environmentenvironmentMap or KEY=value list. A list entry with no value (- KEY) is an error, because Compose would read it from your shell. ${VAR:-default} takes the default, with a warning. Other variables are errors: substitute them first or use --resolve.
portsportsShort and long forms. "3000" alone publishes host port 3000 and warns. Port ranges and host addresses (127.0.0.1:80:80) are errors.
volumes (named)volumesMust be declared under the top-level volumes. :ro becomes readOnly. Anonymous volumes, nocopy and subpath are errors.
volumes (bind)Volume, config, mount or optionSee file binds. /dev/... becomes a device mount.
tmpfs, volumes with type: tmpfsmounts of type tmpfssize and mode are kept.
configsconfigsShort and long syntax. Needs configs.
depends_ondependsOnConditions service_started, service_healthy and service_completed_successfully. restart: and required: are ignored with a warning.
healthcheckhealthcheckNeeds health. See below.
restartrestart, restartMaxAttemptsno, always, on-failure and on-failure:N. unless-stopped becomes always, with a warning. A missing restart becomes always, with a warning.
useruseruid[:gid] or name[:group]. Needs process.user.
group_addgroupAddNeeds process.user.
working_dirworkingDirNeeds process.user.
hostnamehostnameNeeds net.names.
labelslabelsNeeds labels.
devicesdevicesSources under /dev only. CDI device names are an error. Needs devices. Gated by host access.
privilegedprivilegedNeeds security.privileged. Gated by host access.
cap_add, cap_dropcapAdd, capDropNeeds security.caps. cap_add of a powerful capability is gated by host access.
network_modenetwork.modehost applies to the whole set and warns. bridge is accepted. none, service: and container: are errors.
networksaliasesEvery service joins the one set network. Only each service's aliases are kept, with a warning. ipv4_address and similar keys are errors. Needs net.names.
extra_hostsextraHostshost:ip. host-gateway is accepted as the IP. Needs net.names.
dns, dns_search, dns_optdns.servers, dns.search, dns.optionsNeeds net.dns.
ulimitsulimitsOne number or {soft, hard}. Needs limits.ulimits.
sysctlssysctlsNamespaced keys only. Needs limits.sysctls.
shm_sizeshmSizeNeeds limits.shm.
stop_signal, stop_grace_periodstopSignal, stopGracePeriodWhole seconds. Needs stop.
initinitRuns a small init process that reaps stray child processes. Needs init.
read_onlyreadOnlyRoot
mem_limit, deploy.resources.limits.memoryresources.memoryBinary units: 1G is 2^30 bytes.
cpus, deploy.resources.limits.cpusresources.cpusAt most three decimals. Needs limits.cpu.
pids_limit, deploy.resources.limits.pidsresources.pidsNeeds limits.pids.
mem_reservation, deploy.resources.reservations.memoryresources.memoryReservationNeeds limits.memlow.
deploy.restart_policyrestart, restartMaxAttemptsany is always, on-failure with max_attempts, none is no. delay and window are ignored.
secretssecretsPaths under /admrl/secrets/. The file, environment and external sources are not read: upload the files as secret files. Each secret warns with the path to upload. uid, gid and mode are ignored.
profilesSelects services, see Profiles.
x-admrlAdmiral-only service settingsSee x-admrl.

Healthchecks​

test is required, and must start with CMD or CMD-SHELL. A string becomes CMD-SHELL. NONE and disable: true remove the check. Admiral cannot read the image's own HEALTHCHECK, so a service that relies on it needs the check written out.

Missing timings take the Compose defaults: interval 30 seconds, timeout 30 seconds, 3 retries, no start period. Admiral then applies its own limits and warns when it changes a value:

ComposeResult
interval under 5 secondsRaised to 5 seconds.
timeout above intervalLowered to the interval.
start_intervalIgnored. Probes run at the interval from the start.
retries: 0Treated as 3.
A duration that is not whole secondsRounded up to whole seconds, with a warning.

Service keys that are ignored​

These keys are accepted. Each one raises the warning ignored: <reason>.

Compose keyReason
container_nameThe container is named <instance>-<service>.
domainnameThe domain name is not configurable.
annotationsUse labels.
gpus, deploy.resources.reservations.devicesNVIDIA devices are exposed automatically on NVIDIA platforms.
exposeServices on the set network reach every port of each other.
loggingAdmiral collects service output.
tty, stdin_openA compose tty is a pseudo-terminal. Giving a service the device screen is x-admrl.tty.
pull_policy, platformThe device pulls the image for its own architecture.
build (when image is set)The image is pulled. Without image, build is an error.
security_opt: no-new-privileges:trueServices never gain new privileges. Any other security_opt is an error.
scale: 1, deploy.replicas: 1A service always runs one container. Other values are errors.
deploy.update_config, rollback_config, labels, endpoint_modeAdmiral rolls out configuration versions itself.
version (top level)Obsolete in Compose, ignored.

Keys that are errors​

These stop the import. The error reads <key> is not supported: <reason>.

Compose keyReason or alternative
env_fileThe server cannot read files. Inline the variables, or use admrl apply --compose, which inlines them.
extends, includeInline the extended service, or use admrl apply --compose --resolve.
links, external_linksServices reach each other by service name. Remove them.
scale, deploy.replicas above 1; deploy.mode: global; deploy.placementA set runs one copy of each service on one device.
pid, ipc, uts, userns_mode, cgroup, cgroup_parentNamespaces and cgroups are managed by the device.
cpu_count, cpu_percent, cpu_shares, cpu_quota, cpu_period, cpu_rt_runtime, cpu_rt_period, cpusetUse cpus.
oom_kill_disable, oom_score_adj, mem_swappiness, memswap_limit, blkio_config, device_cgroup_rulesNot supported.
isolation, runtime, storage_opt, mac_address, credential_specNot supported.
post_start, pre_stop, develop, provider, models, use_api_socket, attach, volumes_from, label_fileNot supported.
Absolute bind sources other than /dev, /etc/localtime, /etc/timezone and /run/dbusUse a named volume, or a config for a file.
Top-level volumes.<name>.externalVolumes are created on the device.
configs.<name>.environment, external, name, template_driverProvide the text as content.
Any other keyunknown service key. A typo cannot be saved silently.

A service name must match ^[a-z][a-z0-9_-]{0,31}$ and must not be ssh, exec or debug. Names are not rewritten, because a service name is a host name.

Top-level networks is ignored with a warning. Top-level secrets entries are read for their names only. Top-level x-* keys other than x-admrl are dropped with one warning that lists them. Top-level volumes.<name> keys driver, driver_opts, labels and name are ignored with a warning, because volumes are local to the device. A top-level configs.<name> takes content; with file it is created empty by the server, and the CLI fills it from the file.


x-admrl​

x-admrl carries what Compose cannot express, so an exported file is the whole configuration. Docker Compose ignores it. Its keys are the configuration spec's own keys, in camelCase, and are checked as strictly as the spec: an unknown key or a wrong type is an error at its path, for example x-admrl.options.hostResolv.

version is required. This release reads and writes version 1. A file with a higher version is rejected with written by a newer Admiral.

Top level​

x-admrl:
version: 1
configuration:
id: 5c0f3b4e-1a2b-4c3d-8e9f-0a1b2c3d4e5f
name: shop
version: 7
desiredState: STOPPED
edgewire:
services:
- { name: web, protocol: tcp, port: 8080, service: web }
signaturePolicy:
required: true
options:
hostResolv: true
KeyMeaning
versionRequired. 1.
configuration.id, .name, .versionWhere the file came from. Written by export. When id is the configuration being updated, version is the default base version. They are never applied. name names the configuration on create when the file has no top-level name.
desiredStateRUNNING or STOPPED. Omitted when RUNNING.
edgewireEdgeWire services, as in the spec.
signaturePolicyImage signature trust for the set, as in the spec.
optionsSet options, as in the spec. Only keys that differ from the default are written.

options accepts hostResolv, hostHosts, isolateDevices, exposeDBus, disableHostBluetooth and imageCleaning (enabled, retentionCount, intervalHours, maxAgeDays, pruneOnUpdate, pruneDangling). It also accepts newPrivileges, privileged, parentCgroupDevices, cgroup, maskedPaths, readonlyPaths, capabilities and devices, which exist for compatibility with older configurations and are not applied by current devices. Use the per-service privileged, cap_add and devices keys instead.

Per service​

services.<name>.x-admrl is written last in each service.

KeyValueSpec fieldWritten when
registryCredentialIdstringregistryCredentialIdThe service has a registry credential.
secretsallsecrets: ["*"]The service sees every secret file in scope.
ttybooleanttyThe service owns the device screen and keyboard.
ephemeralRootbooleanephemeralRootThe service uses a temporary root layer.
processDefaultsrootprocessDefaultsThe service runs as root in /. Services without this key use the image's USER, WORKDIR and STOPSIGNAL.
onUnhealthynonehealthcheck.onUnhealthyAn unhealthy service is only reported, not restarted. Needs a healthcheck.
mountOptionsmap, target to listmounts[].optionsA device bind mount has options other than the rbind and ro that its compose form implies.
mountOrderlist of targetsorder of mountsMount targets nest and their order matters.

secrets: all cannot be combined with a secrets: list on the same service.

Per volume​

volumes.<name>.x-admrl holds settings that Compose has no key for.

KeyMeaning
backup.enabledTake backup snapshots of the volume.
optionsLinux mount options such as rbind and rw. ro makes every attachment read-only.
sourceLegacy host source directory carried over from older configurations.

Example​

name: edge-stack
x-admrl:
version: 1
edgewire:
services:
- { name: web, protocol: tcp, port: 8080, service: web }
services:
web:
image: ghcr.io/example/web:1.4
ports:
- "80:8080"
restart: always
x-admrl:
registryCredentialId: 5c0f3b4e-0000-0000-0000-000000000000
processDefaults: root
volumes:
data:
x-admrl:
backup:
enabled: true