CV-S005: Invalid Volume Format
Error Schema
Why This Matters
Docker Compose volumes accept short syntax strings ("SOURCE:TARGET" or "SOURCE:TARGET:MODE" where mode is ro, rw, z, or Z), named volumes ("volume_name:/container/path"), and long syntax objects with type (bind, volume, tmpfs, npipe, cluster), source, target, and optional read_only, bind, volume, or tmpfs sub-options. A common mistake is specifying only the source path without a target (e.g., "./data" instead of "./data:/app/data"), which does not create a valid mount. Avoid backslashes in paths even on Windows; Compose normalizes forward slashes.
How to Fix
Use valid SOURCE:TARGET[:MODE] short syntax or long syntax with type, source, and target.
Before (incorrect)
volumes:
- ./data After (correct)
volumes:
- ./data:/app/data Rule Details
- Rule Code
- CV-S005
- Severity
- Error
- Category
- Schema