-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem
The current docker-compose.yml validation in validator.py performs ad-hoc checks that can become out of sync with actual Docker Compose behavior. For example, we required the version field which is now obsolete in Docker Compose v2+.
Current validation
The validator checks:
versionfield exists and is >= 3.8 (now optional in Compose v2+)servicessection exists- Other structural checks
Proposed solutions
- Minimal validation: Only validate that the file is valid YAML
- Use official schema: Use Docker Compose's JSON schema for validation
- Validate with target tool: Run
docker compose configto validate using the actual tool
Recommendation
Option 3 (validate with target tool) would be most reliable as it ensures the compose file works with the actual Docker Compose version installed. However, it requires Docker to be available during validation.
Option 1 (minimal validation) is the simplest and avoids this class of bugs entirely - let Docker Compose report any errors at runtime.
Related
- PR fix(validator): make docker-compose version field optional #76 made
versionfield optional after it broke builds
Metadata
Metadata
Assignees
Labels
No labels