You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Docker Compose detection depends on the following to successfully run:
6
+
7
+
- One or more Docker Compose files matching the patterns: `docker-compose.yml`, `docker-compose.yaml`, `docker-compose.*.yml`, `docker-compose.*.yaml`, `compose.yml`, `compose.yaml`, `compose.*.yml`, `compose.*.yaml`
8
+
9
+
The `DockerComposeComponentDetector` is a **DefaultOff** detector and must be explicitly enabled via the `--DetectorArgs` parameter.
10
+
11
+
## Detection strategy
12
+
13
+
The Docker Compose detector parses YAML compose files to extract Docker image references from service definitions.
14
+
15
+
### Service Image Detection
16
+
17
+
The detector looks for the `services` section and extracts the `image` field from each service:
18
+
19
+
```yaml
20
+
services:
21
+
web:
22
+
image: nginx:1.21
23
+
db:
24
+
image: postgres:14
25
+
```
26
+
27
+
Services that only define a `build` directive without an `image` field are skipped, as they do not reference external Docker images.
28
+
29
+
### Full Registry References
30
+
31
+
The detector supports full registry image references:
32
+
33
+
```yaml
34
+
services:
35
+
app:
36
+
image: ghcr.io/myorg/myapp:v2.0
37
+
```
38
+
39
+
### Variable Resolution
40
+
41
+
Images containing unresolved variables (e.g., `${TAG}` or `${REGISTRY:-docker.io}`) are skipped to avoid reporting incomplete or incorrect references. The detector checks for `$`, `{`, or `}` characters in image references.
42
+
43
+
## Known limitations
44
+
45
+
- **DefaultOff Status**: This detector must be explicitly enabled using `--DetectorArgs DockerCompose=EnableIfDefaultOff`
46
+
- **Variable Resolution**: Image references containing unresolved environment variables or template expressions are not reported, which may lead to under-reporting in compose files that heavily use variable substitution
47
+
- **Build-Only Services**: Services that only specify a `build` directive without an `image` field are not reported
48
+
- **No Dependency Graph**: All detected images are registered as independent components without parent-child relationships
0 commit comments