Compose "additional property ... is not allowed" schema error in CI
Compose validates the file against its schema before doing anything. "additional property <key> is not allowed" means a key is misspelled or placed at the wrong level, so the schema rejects it.
What this error means
A compose command fails with "validating docker-compose.yml: services.web additional property buld is not allowed" or a similar unexpected-key message.
compose
validating docker-compose.yml: services.web additional property buld is not allowedCommon causes
A misspelled key
A typo like buld instead of build, or enviroment instead of environment, is not a known schema property.
A key at the wrong nesting level
A valid key placed under the wrong parent (for example a build option directly under the service) is rejected by the schema.
How to fix it
Correct the key name and placement
- Read the path in the message (e.g.
services.web) and the offending property. - Fix the spelling or move the key under the correct parent.
- Re-validate with
docker compose config.
docker-compose.yml
services:
web:
build: ./web
environment:
- NODE_ENV=testValidate the file in CI before using it
Run config validation as an early step so schema errors fail fast with a clear path.
Terminal
docker compose config -qHow to prevent it
- Validate compose files with
docker compose configin CI. - Use editor schema support to catch unknown keys.
- Mind nesting levels for build and deploy options.
Related guides
Compose "service ... refers to undefined secret" in CIFix Compose "service X refers to undefined secret Y" in CI - a service lists a secret that has no matching to…
Compose "invalid project name" in CIFix Compose "invalid project name X: must consist only of lowercase alphanumeric characters, hyphens, and und…
Compose "no such service" in CIFix Compose "no such service: X" in CI - a compose command named a service that does not exist in the resolve…