dockerfile

A command that checks Dockerfiles for GPU and CUDA setup problems before a build. CUDA is the software layer that lets applications use NVIDIA GPUs for computation.

In plain words
What is it for?
Use it to inspect a Dockerfile, validate PyTorch and other GPU libraries, choose runtime or development images, and find common NVIDIA setup mistakes.
Why use it?
It catches mismatched images, library versions, installation commands, and build requirements before they cause a failed or bloated container build.

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/dockerfile
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 713 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 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.00713
Opus 5 $0.00000 $0.00357
Sonnet 5 $0.00000 $0.00143
Haiku 4.5 $0.00000 $0.00071

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

Security

Grade A, and why

dockerfile scanned grade A with 0 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 2d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

docs/commands/dockerfile.md · 114 lines

How it starts

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

dockerfile

Validate Dockerfiles for GPU/CUDA configuration issues before building.

Usage

env-doctor dockerfile [PATH]

If no path is provided, looks for Dockerfile in the current directory.

What It Validates

Base Images

  • Detects CPU-only images (python:3.10, ubuntu:22.04)
  • Provides DB-driven GPU base image recommendations
  • Suggests appropriate runtime vs devel images

PyTorch Installation

  • Ensures pip install torch has correct --index-url
  • Validates version compatibility with base image CUDA
  • Uses verified install commands from the database

Library Compatibility

  • Validates pinned versions against DB-verified combinations
  • Checks multi-library compatibility (torch + tensorflow + jax)
  • Flags deprecated packages (tensorflow-gpu)

Build Requirements

  • Detects compilation requirements (flash-attn, xformers)
  • Enforces -devel base images when needed
  • Warns about unnecessary toolkit installs

Common Mistakes

  • Flags NVIDIA driver installs (must be on host)
  • Warns about bloating images with unnecessary packages

Example Output

🐳  DOCKERFILE VALIDATION: Dockerfile

❌  ERRORS (2):
------------------------------------------------------------

Line 1:
  Issue: CPU-only base image detected: python:3.10
  Fix:   Use a GPU-enabled base image

  Suggested fix:
    FROM nvidia/cuda:12.1.0-runtime-ubuntu22.04
    # Or: FROM pytorch/pytorch:2.1.0-cuda12.1-cudnn8-runtime
    # Or: FROM tensorflow/tensorflow:latest-gpu

Line 8:
  Issue: PyTorch installation missing --index-url flag
  Fix:   Add --index-url to install the correct CUDA version

  Suggested fix:
    RUN pip install torch torchvision --index-url https://download.pytorch.org/whl/cu121

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

Line 15:
  Issue: Installing CUDA toolkit in container
  Fix:   Use a CUDA base image instead to reduce image size

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

Read the full file on GitHub · 114 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. 2d ago First seen · 114 lines · 0 tokens per session scan A d75c5173288f

Subscribe to this mod's changes

dockerfile 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 713 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.