{
  "id": 20153239,
  "title": "Docker Compose build must be a string, in CI",
  "url": "https://urgent.news/2026/11/15/docker-compose-build-must-be-a-string-in-ci",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-15T09:53:47.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/kalemi/docker-compose-build-must-be-a-string-in-ci-3bj1"
  },
  "original_language": "en",
  "account": "Docker Compose build must be a string is an error that occurs when the value under the build key is not a string or a mapping. This rule applies when running docker compose build, docker compose config, or docker compose up --build. The error message indicates the key and the type that is invalid. The mapping branch of the rule is also invalid, but it is not specifically mentioned in the error message. The error can be caused by various issues such as a stray dash turning a mapping into a list or a key with no value. It is recommended to validate the Compose files in CI before building, use an editor with a Compose schema, quote values written by a generator, and remove keys with empty values.",
  "summary": "Docker Compose build must be a string is the schema validator naming one branch of a rule with two, and following it literally will send you to rewrite a mapping that was never the problem. Compose accepts a path string or a mapping under build , and the message picks the first branch it checked rather than listing both. The schema allows a string or a mapping. Both branches fail, both are…",
  "key_points": [
    "\"Docker Compose build must be a string\" error occurs",
    "Invalid key type or mapping branch causes the error",
    "Validate Compose files in CI to prevent the error"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}