Docker Compose "Additional property X is not allowed" in CI
Compose validated your file against its schema and found a key it does not recognize at that position. Usually a typo (enviroment), a wrong nesting level, or a key that belongs elsewhere.
What this error means
A docker compose up/config fails with services.<name> Additional property <key> is not allowed. The file parses as YAML but violates the Compose schema at the named key.
services.web Additional property buld is not allowed
# "buld" is a typo for "build"; the schema has no "buld" keyDiagnose it: read the resolved config, not the file you wrote
Compose merges override files, interpolates variables, and applies defaults before it does anything. Most Compose failures in CI are visible in the resolved configuration and invisible in the source file, because the value you are debugging came from an unset variable that quietly became an empty string.
# the fully merged, interpolated configuration Compose will actually run
docker compose config
# fail loudly on unset variables instead of silently interpolating empty
docker compose --env-file .env config --quiet || echo "invalid"
# which override files were picked up
docker compose config --services
Common causes
A misspelled key
Typos like buld, enviroment, volums, or command_line are not in the schema, so Compose reports them as disallowed additional properties.
A key at the wrong nesting level
A valid key placed under the wrong parent (e.g. image under build: instead of under the service) is "additional" where it sits, even though it is valid elsewhere.
A key from a different Compose spec version
A property only valid in another schema version, or removed/renamed, fails validation against the version in use.
How to fix it
Fix the key name and indentation
Correct the typo or move the key to the right level.
services:
web:
build: ./web # not "buld"
environment: # not "enviroment"
- NODE_ENV=productionValidate against the schema
Render the resolved config so the exact offending key is reported.
docker compose configBind mounts behave differently on a runner
- A relative bind source is resolved against the compose file location, not the working directory of the shell that invoked it.
- The host path must exist before
up. Compose creates missing directories for named volumes but not for bind mounts, and the failure surfaces as a mount error rather than a missing-path error. - On a CI runner the workspace path differs from your machine, so any absolute host path in a compose file is a portability bug waiting for its first CI run.
- Prefer named volumes for anything that does not genuinely need to be read from the host. They remove the whole class of problem.
How to prevent it
- Run
docker compose configin CI before bringing services up. - Use an editor with the Compose JSON schema for inline key validation.
- Keep indentation consistent so keys attach to the intended parent.