Improve this doc

docker-compose.yml fields

Supported fields

Field Details
build
cap_add
cap_drop
cgroup_parent
command
cpu_shares
cpu_quota
cpus
cpuset
devices
depends_on Only array form is supported
dns
dns_opt
dns_search
domainname
entrypoint
environment
expose
extra_hosts
group_add
healthcheck
hostname
image
init
ipc
labels
mac_address
mem_limit
mem_reservation
network_mode Only support bridge, host, or none
networks Only support specifying network names
oom_kill_disable
oom_score_adj
pid Only support host or none
pids_limit
ports
privileged
read_only
restart
security_opt
shm_size
stop_grace_period
stop_signal
sysctls
tmpfs
ulimits
user
userns_mode
volumes Only support short syntax and named volumes. Bind mounts are not supported, except for as allowed by balena specific labels
working_dir

Known unsupported fields

Field Details
blkio_config
container_name Used by the device supervisor
cpu_count
cpu_percent
external_links
isolation
links
logging
memswap_limit
mem_swappiness
runtime
scale
stdin_open
tty
volume_driver
volumes_from

Labels

Note: If you have devices in your app that have a supervisor version lower than 7.22.0, then you should use the io.resin.features. form of the labels to ensure that all devices obey the label. Earlier supervisor versions will not understand the io.balena.features label.

Label Default Description
io.balena.features.balena-socket false Bind mounts the balena container engine socket into the container
io.balena.features.dbus false Bind mounts the host OS dbus into the container using /run/dbus:/host/run/dbus
io.balena.features.kernel-modules false Bind mounts the host OS /lib/modules into the container. (i.e. /lib/modules:/lib/modules)
io.balena.features.firmware false Bind mounts the host OS /lib/firmware into the container
io.balena.features.supervisor-api false Ensures that BALENA_SUPERVISOR_HOST, BALENA_SUPERVISOR_PORT, BALENA_SUPERVISOR_ADDRESS, and BALENA_SUPERVISOR_API_KEY are added to the container environment variables, so the supervisor API can be used.
io.balena.features.balena-api false When enabled, it will make sure that BALENA_API_KEY is added to the container environment variables
io.balena.update.strategy download-then-kill Set the application update strategy
io.balena.update.handover-timeout 60000 Time, in milliseconds, before an old container is automatically killed. Only used with the hand-over update strategy.

These labels are applied to a specific service with the labels: setting:

labels:
      io.balena.features.kernel-modules: '1'
      io.balena.features.firmware: '1'
      io.balena.features.dbus: '1'
      io.balena.features.supervisor-api: '1'
      io.balena.features.balena-api: '1'
      io.balena.update.strategy: download-then-kill
      io.balena.update.handover-timeout: ''