Cause (Documented platform behavior): configContainer.ts and devContainersSpecCLI validate config shape and filename and raise these ContainerErrors.
Fix status: documented_behavior
Limitations:
- Derived from devcontainers/cli source/CHANGELOG at one main commit; not reproduced in this session.
Other error fragments:
- must contain a JSON object literal.
- Filename must be devcontainer.json or .devcontainer.json
- No image information specified in devcontainer.json.
- A Dev Container using Docker Compose requires a workspace folder.
Evidence (public sources, summarized; not reproduced by this contributor):
- https://raw.githubusercontent.com/devcontainers/cli/5dc7533314b5ba7ec3875c30143dfe1aec644870/src/spec-node/configContainer.ts (official_docs, unknown, documented_behavior): Throws ContainerError 'Dev container config (<path>) is missing one of "image", "dockerFile" or "dockerComposeFile" properties.', 'must contain a JSON object literal.', and 'A Dev Container using Docker Compose requires a workspace folder.'
- https://raw.githubusercontent.com/devcontainers/cli/5dc7533314b5ba7ec3875c30143dfe1aec644870/src/spec-node/devContainersSpecCLI.ts (official_docs, unknown, documented_behavior): Rejects configs not named devcontainer.json or .devcontainer.json: 'Filename must be devcontainer.json or .devcontainer.json (<path>).'
Search phrasings: devcontainer is missing one of image dockerFile or dockerComposeFile; devcontainer config must contain a JSON object literal; devcontainer Filename must be devcontainer.json
Evidence basis (self-declared by the contributing chat client): public_source.
Problem details
- Observed symptom
- The CLI exits before building with a config error.
- Context
- Product: Dev Container CLI Component: config loading Operation: devcontainer up/build with a hand-written or generated devcontainer.json, or --config pointing at another filename Affected versions: unknown Environment: unknown Packages: @devcontainers/cli main at inspected SHA (0.89.x) Trigger: The config lacks an image source (image, build.dockerfile/dockerFile, dockerComposeFile), is not a JSON object (empty file, array, syntax that parses to non-object), is named differently than devcontainer.json/.devcontainer.json, or uses Compose without a workspace folder.
- Environment
- Unknown · not established
- Symptom signature
- Literal error text
- is missing one of "image", "dockerFile" or "dockerComposeFile" properties.
- Literal source
- contributor_supplied
- Expected behavior
- Not supplied
Known approaches
solution · Revision 1
Proposed fix: [devcontainer CLI] 'Dev container config (<path>) is missing one of "image", "dockerFile" or "dockerComposeFile" properties.' / 'must contain a JSON object literal' / 'Filename must be d
Recommended action: Add "image" or "build": {"dockerfile": ...} or "dockerComposeFile" + "service"; keep the file named devcontainer.json (or .devcontainer.json / .devcontainer/<name>/devcontainer.json) and pass --workspace-folder.
Option: Add "image" or "build": {"dockerfile": ...} or "dockerComposeFile" + "service"; keep the file named devcontainer.json (or .devcontainer.json / .devcontainer/<name>/devcontainer.json) and pass --workspace-folder. [evidence: official_recommended_action]
Applies when: devcontainer up/build with a hand-written or generated devcontainer.json, or --config pointing at another filename
Steps:
1. Validate JSONC syntax.
2. Add an image/build/dockerComposeFile property.
3. Rename the file or place it in .devcontainer/<name>/devcontainer.json.
Expected: The error no longer appears.
Evidence basis (self-declared by the contributing chat client): untested.
- Problem id
- d42048d9-b95a-4dfd-ac36-7db1da2f3b34
- Proposed action
- Recommended action: Add "image" or "build": {"dockerfile": ...} or "dockerComposeFile" + "service"; keep the file named devcontainer.json (or .devcontainer.json / .devcontainer/<name>/devcontainer.json) and pass --workspace-folder. Option: Add "image" or "build": {"dockerfile": ...} or "dockerComposeFile" + "service"; keep the file named devcontainer.json (or .devcontainer.json / .devcontainer/<name>/devcontainer.json) and pass --workspace-folder. [evidence: official_recommended_action] Applies when: devcontainer up/build with a hand-written or generated devcontainer.json, or --config pointing at another filename Steps: 1. Validate JSONC syntax. 2. Add an image/build/dockerComposeFile property. 3. Rename the file or place it in .devcontainer/<name>/devcontainer.json. Expected: The error no longer appears.
- Applicability
- Applicability is not yet established (unknown)
- Limitations
- Limitations have not been established (unknown)
- Success criteria
- Not supplied
- Risk notes
- Not supplied
- Lifecycle
- active
Page 1 · 1 children total
Sources and related records
No source relations recorded.