dockerfile-linting
Skill8 starsChanged 7 months agoApache-2.0View on GitHub
Lint Dockerfiles using hadolint according to standard best practices. Use when asked to lint or check style/security issues in Dockerfiles.
- Installs packages
In this repository54 other files it gives its agents.
- alibabacloud-cliSkill
- ansible-cliSkill
- appdynamics-cliSkill
- argocd-cliSkill
- aws-cliSkill
- aws-cloudwatch-cliSkill
- azure-cliSkill
- bash-lintingSkill
- betterstack-cliSkill
- bitbucket-cliSkill
- chef-cliSkill
- code-reviewSkill
- commit-codeSkill
- create-dockerfileSkill
- create-terraform-helm-upgrade-planSkill
- datadog-cliSkill
- digitalocean-cliSkill
- dynatrace-cliSkill
- elasticsearch-cliSkill
- gcp-cliSkill
- github-cliSkill
- gitlab-cliSkill
- go-lintingSkill
- grafana-cliSkill
- grafana-loki-cliSkill
- graylog-cliSkill
- helm-cliSkill
- hetzner-cliSkill
- huaweicloud-cliSkill
- jaeger-cliSkill
- jenkins-cliSkill
- jira-and-confluence-cliSkill
- kibana-cliSkill
- kubernetes-cliSkill
- loggly-cliSkill
- maintenance-check-aws-eksSkill
- maintenance-create-ticket-on-jiraSkill
- ms-teams-cliSkill
- mysql-cliSkill
- newrelic-cliSkill
- oci-cliSkill
- packer-cliSkill
- papertrail-cliSkill
- postgresql-cliSkill
- prometheus-cliSkill
- python-lintingSkill
- rollbar-cliSkill
- salesforce-cliSkill
- sentry-cliSkill
- slack-cliSkill
- splunk-cliSkill
- terraform-cliSkill
- terraform-lintingSkill
- vault-cliSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 1 is distinctive, and 4 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
4
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Run this skill when asked to lint or check a Dockerfile for issues.
- Very specific: line 17
If hadolint is not installed, inform the user and ask before installing:
- Very specific: line 60
NEVER install hadolint without asking the user first.
- Very specific: line 63
Always flag missing non-root USER, unpinned base image tags, and unpinned package versions even if hadolint's default severity for them is …
- Very specific: line 64
Do not suggest disabling a rule via inline # hadolint ignore=DLxxxx comments unless the user explicitly asks for an exception and confirms …
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Dockerfile Linting Skill
Run this skill when asked to lint or check a Dockerfile for issues.
Step 1 — Detect available tooling
which hadolint 2>/dev/null
ls .hadolint.yaml .hadolint.yml 2>/dev/nullIf hadolint is not installed, inform the user and ask before installing:
brew install hadolintStep 2 — Find Dockerfiles
find . -type f \( -iname "Dockerfile" -o -iname "Dockerfile.*" -o -iname "*.dockerfile" \) -not -path "*/node_modules/*" -not -path "*/.git/*"Step 3 — Run linting (read-only check)
hadolint <Dockerfile>Respect the project's .hadolint.yaml if present (e.g. ignored rules) — do not override it.
Report all findings grouped by file, with line numbers, rule codes (e.g. DL3008), and severity (error/warning/info/style).
Step 4 — Explain and suggest fixes
hadolint does not auto-fix — for each finding, show the offending line and a suggested replacement. Common fixes:
DL3008/DL3018/DL3028: pin package versions (e.g.apt-get install -y package=1.2.3).DL3009: clean up package manager caches in the sameRUNlayer.DL3025: use JSON/exec form forCMD/ENTRYPOINT.DL3002: avoid running as root — add aUSERinstruction.DL3006: pin the base image tag (avoidlatest).DL4006: setSHELL ["/bin/bash", "-o", "pipefail", "-c"]before any pipedRUNcommand.
Rules
- NEVER install
hadolintwithout asking the user first. - Respect the project's existing
.hadolint.yamlignore list — do not re-flag rules the project has intentionally silenced, but you may mention them if they look unsafe (e.g. ignoringDL3002, running as root). - Report the exact command run and its full output — do not summarize away findings.
- Always flag missing non-root
USER, unpinned base image tags, and unpinned package versions even ifhadolint's default severity for them is only "info" or "style" — these are security-relevant in production images. - Do not suggest disabling a rule via inline
# hadolint ignore=DLxxxxcomments unless the user explicitly asks for an exception and confirms the reason.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

