docker-compose

A validator for Docker Compose files, which describe how multiple containers run together, with GPU settings.

In plain words
What is it for?
Checking GPU settings for each service, spotting deprecated configuration, warning about shared GPUs, and checking required host support.
Why use it?
It finds missing or outdated NVIDIA GPU configuration before a container fails to start or cannot use the GPU.

Command

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/mitulgarg/env-doctor/docker-compose
Clone the repo
git clone --depth 1 https://github.com/mitulgarg/env-doctor
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 762 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 2 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00000 $0.00762
Opus 5 $0.00000 $0.00381
Sonnet 5 $0.00000 $0.00152
Haiku 4.5 $0.00000 $0.00076

Measured 3d ago against content hash 1d99f17cf9d7, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade B, and why

docker-compose scanned grade B with 2 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 3d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Asks for rootmediumPrivilege escalation

A mod that escalates privileges can change anything on the machine, not only the project.

curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -

Makes network callslowCapability

Not a fault in itself. Listed so you know the mod talks to something, and to what.

curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
docs/commands/docker-compose.md · 151 lines

How it starts

The opening of the file, as written. The whole thing — 151 lines — stays where its author put it; the contents beside it link to each section on GitHub.

docker-compose

Validate docker-compose.yml files for proper GPU device configuration.

Usage

env-doctor docker-compose [PATH]

If no path is provided, looks for docker-compose.yml or docker-compose.yaml in the current directory.

What It Validates

GPU Device Configuration

  • Checks for deploy.resources.reservations.devices
  • Validates driver: nvidia is specified
  • Ensures capabilities: [gpu] is set

Deprecated Syntax

  • Flags old runtime: nvidia approach
  • Provides migration path to new syntax

Multi-Service Configuration

  • Warns about GPU resource sharing between services
  • Validates each service with GPU requirements

Host Requirements

  • Checks for nvidia-container-toolkit
  • Validates Docker GPU support

Example Output

🐳  DOCKER COMPOSE VALIDATION: docker-compose.yml

❌  ERRORS (1):
------------------------------------------------------------

Service 'ml-training':
  Issue: Missing GPU device configuration
  Fix:   Add GPU device configuration under deploy.resources.reservations.devices

  Suggested fix:
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all
              capabilities: [gpu]

⚠️   WARNINGS (1):
------------------------------------------------------------

Service 'legacy-app':
  Issue: Deprecated 'runtime: nvidia' syntax
  Fix:   Use the new 'deploy.resources.reservations.devices' syntax instead

SUMMARY:
  ❌ Errors:   1
  ⚠️  Warnings: 1
  ℹ️  Info:     0

Correct GPU Configuration

Modern Syntax (Compose v2.4+)

services:
  ml-training:
    image: pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              count: all  # or specific number: count: 1
              capabilities: [gpu]

Device Selection

# Use all GPUs
count: all

# Use specific number of GPUs
count: 2

# Use specific GPU by ID
device_ids: ['0', '2']

Read the full file on GitHub · 151 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 3d ago First seen · 151 lines · 0 tokens per session scan B 1d99f17cf9d7

Subscribe to this mod's changes

docker-compose is a command published in the GitHub repository mitulgarg/env-doctor (172 stars, last pushed 3d ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 762 tokens. A static security scan graded it B with 2 findings (asks for root, makes network calls). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.