Dockerignore Linter
/install dockerignore-linter
Dockerignore Linter
Lint .dockerignore files for syntax issues, security risks, missing essential patterns, and optimization opportunities.
Commands
All commands use the bundled Python script at scripts/dockerignore_linter.py.
1. Lint a .dockerignore file
python3 scripts/dockerignore_linter.py lint \x3Cfile> [--strict] [--format text|json|markdown]
Run all validation rules.
2. Audit for security-sensitive files
python3 scripts/dockerignore_linter.py security \x3Cfile> [--format text|json|markdown]
Check if secrets, credentials, and sensitive files are properly excluded.
3. Suggest missing patterns
python3 scripts/dockerignore_linter.py suggest [--project-type node|python|go|rust|java|ruby|generic] [--format text|json]
Generate recommended .dockerignore patterns for a project type.
4. Analyze Docker build context
python3 scripts/dockerignore_linter.py context \x3Cdirectory> [--dockerignore \x3Cfile>] [--format text|json]
Show which files would be included in the Docker build context, with size breakdown.
Lint Rules (18 total)
Syntax (4 rules)
- empty-file — .dockerignore is empty
- invalid-pattern — Malformed glob pattern
- duplicate-pattern — Same pattern appears twice
- negation-conflict — Negation
!overrides a previous exclusion (likely unintended)
Security (6 rules)
- missing-env —
.envnot excluded (may contain secrets) - missing-secrets — Common secret files not excluded (*.pem, *.key, id_rsa, etc.)
- missing-git —
.gitdirectory not excluded (exposes history + credentials) - missing-credentials — Credential files not excluded (aws/credentials, .npmrc with tokens, etc.)
- missing-docker — Docker-related files not excluded (docker-compose*.yml, Dockerfile*)
- missing-ide — IDE config not excluded (.vscode, .idea, *.swp)
Optimization (4 rules)
- missing-deps — Dependency directories not excluded (node_modules, pycache, vendor, target)
- missing-build — Build output not excluded (dist, build, *.o, *.pyc)
- missing-logs — Log files not excluded (*.log, logs/)
- missing-test — Test data/coverage not excluded (coverage, .nyc_output, htmlcov)
Best Practices (4 rules)
- too-broad — Pattern is overly broad (e.g.,
*without specific negations) - commented-pattern — Inline comment after pattern (not supported, treated as literal)
- trailing-space — Pattern has trailing whitespace
- readme-excluded — README/docs excluded (usually should be kept for reference)
Output Formats
Text, JSON, Markdown — same structure as other linters.
CI Integration
- name: Lint Dockerignore
run: python3 scripts/dockerignore_linter.py lint .dockerignore --strict
Exit codes: 0 = clean, 1 = issues found.
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install dockerignore-linter - After installation, invoke the skill by name or use
/dockerignore-linter - Provide required inputs per the skill's parameter spec and get structured output
What is Dockerignore Linter?
Lint, validate, and audit .dockerignore files for syntax issues, security risks, missing patterns, and optimization opportunities. Use when asked to lint, va... It is an AI Agent Skill for Claude Code / OpenClaw, with 94 downloads so far.
How do I install Dockerignore Linter?
Run "/install dockerignore-linter" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Dockerignore Linter free?
Yes, Dockerignore Linter is completely free, licensed under MIT-0. You can download, install and use it at no cost.
Which platforms does Dockerignore Linter support?
Dockerignore Linter is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Dockerignore Linter?
It is built and maintained by charlie-morrison (@charlie-morrison); the current version is v1.0.0.