Dockerfile Linter Online
Lint a Dockerfile: unpinned or latest base images, root user, secrets in ENV / ARG, ADD URLs, apt / apk / pip cache, curl | sh, stage and syntax errors.
Result
Press “Run” to see the result.
Send a Dockerfile (text, file or raw body) and get findings with line numbers, severity (error / warning / info), a short fix and a 0-100 score. The parser understands line continuations, the # escape= directive, BuildKit heredocs, JSON and shell forms and multi-stage builds.
Checks include: base image without tag or with :latest (digest pinning with strict=1), no USER or USER root in the final stage, literal secrets in ENV / ARG and known token formats anywhere, ADD from a URL without --checksum, ADD for local files, apt-get without -y, --no-install-recommends, update in the same layer or list cleanup, apk add without --no-cache, yum / dnf clean, pip --no-cache-dir, unpinned packages, npm install instead of npm ci, curl | sh, missing pipefail, cd instead of WORKDIR, sudo, chmod 777, COPY . . before installing dependencies (cache busting), several CMD / ENTRYPOINT, shell-form CMD, invalid EXPOSE, unknown or duplicate stage names in COPY --from, MAINTAINER, missing HEALTHCHECK.
Rules are our own (hadolint is GPL and is not used; there is no ShellCheck, so RUN scripts are checked heuristically). Filter with ignore (rule ids) and min_severity. The response lists the base images so you can check them with /v1/eol-check; Kubernetes manifests are validated by /v1/k8s-validate, CI workflows by /v1/ci-validate.
Use this in your code
curl -X POST "https://apibox.io.vn/v1/dockerfile-lint" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{"dockerfile":"FROM node:latest\nWORKDIR /app\nCOPY . .\nRUN npm install\nENV API_TOKEN=s3cr3t-value\nEXPOSE 3000\nCMD node server.js\n"}'const res = await fetch('https://apibox.io.vn/v1/dockerfile-lint', {
method: 'POST',
headers: {
Authorization: 'Bearer YOUR_API_KEY',
'Content-Type': 'application/json',
},
body: JSON.stringify({
"dockerfile": "FROM node:latest\nWORKDIR /app\nCOPY . .\nRUN npm install\nENV API_TOKEN=s3cr3t-value\nEXPOSE 3000\nCMD node server.js\n"
}),
});
const data = await res.json();
console.log(data);import requests
res = requests.post(
"https://apibox.io.vn/v1/dockerfile-lint",
headers={"Authorization": "Bearer YOUR_API_KEY"},
json={"dockerfile": "FROM node:latest\nWORKDIR /app\nCOPY . .\nRUN npm install\nENV API_TOKEN=s3cr3t-value\nEXPOSE 3000\nCMD node server.js\n"},
timeout=30,
)
print(res.json())<?php
$ch = curl_init('https://apibox.io.vn/v1/dockerfile-lint');
curl_setopt_array($ch, [
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_HTTPHEADER => ['Authorization: Bearer YOUR_API_KEY', 'Content-Type: application/json'],
CURLOPT_POSTFIELDS => '{"dockerfile":"FROM node:latest\\nWORKDIR /app\\nCOPY . .\\nRUN npm install\\nENV API_TOKEN=s3cr3t-value\\nEXPOSE 3000\\nCMD node server.js\\n"}',
]);
$response = curl_exec($ch);
print_r(json_decode($response, true));API documentation → Get a free API key
FAQ
Is this hadolint?
No. The rules are written from scratch (hadolint is GPL-3.0); they cover the most common hadolint-style checks plus secrets and cache-order hints.
Are RUN scripts analysed?
With heuristics for package managers, downloads, pipes, cd, sudo and permissions; there is no full shell analysis (ShellCheck).
Can I silence a rule?
Yes: pass rule ids in ignore (comma-separated) or raise min_severity to warning or error.