Docker Compose limitations
This article refers to Platform v2.9.0. The current Platform version is v3.2.0.
Overview
docker-compose.yaml is the unit of deployment for every Docker app on Barbara, but the agent's parser has a few quirks that diverge from upstream Compose. This article lists the four most common ones and shows the correct form for each. Pair this with How to package a Docker app when you build a new app.
restart: "no" must be quoted
YAML interprets unquoted no as the boolean false, but Compose expects a string. Quote it.
- Incorrect
- Correct
service-name:
image: ${SERVICE_IMAGE:-service-xxx:latest}
restart: no
service-name:
image: ${SERVICE_IMAGE:-service-xxx:latest}
restart: "no"
Remember that the always restart policy is forbidden on Barbara nodes. Use unless-stopped as the default. See Restart policies.
No top-level name: property
Omit the top-level name: property — the Barbara agent assigns its own project name based on the application's identity in Panel.
- Incorrect
- Correct
name: customName
networks:
...
networks:
...
No tty: property
Drop the tty: property from services. The Barbara agent runs containers without an interactive TTY.
- Incorrect
- Correct
service-name:
image: ${SERVICE_IMAGE:-service-xxx:latest}
tty: true
service-name:
image: ${SERVICE_IMAGE:-service-xxx:latest}
env_file: must be a list
Even when you load a single env file, declare it as a YAML list (one entry, prefixed with -).
- Incorrect
- Correct
service-name:
image: ${SERVICE_IMAGE:-service-xxx:latest}
env_file: user.env
service-name:
image: ${SERVICE_IMAGE:-service-xxx:latest}
env_file:
- user.env
Summary
Four small parser quirks, four small fixes: quote "no" for restart, drop the top-level name:, drop tty:, and write env_file: as a list. Apply these to your compose file before packaging, and the Barbara agent will install the app on the first try.