Skip to content
Latchkey

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.

docker compose output
services.web Additional property buld is not allowed
# "buld" is a typo for "build"; the schema has no "buld" key

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.

docker-compose.yml
services:
  web:
    build: ./web        # not "buld"
    environment:        # not "enviroment"
      - NODE_ENV=production

Validate against the schema

Render the resolved config so the exact offending key is reported.

Terminal
docker compose config

How to prevent it

  • Run docker compose config in 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.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →