Dockerfile Check

Dockerfile Check is a copy-paste React component that stops docker image runs as root with secrets before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/dockerfile-check
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsDocker image runs as root with secrets

Was this component page useful?

How do I install Dockerfile Check?

pnpm dlx shadcn@latest add @bollard/dockerfile-check

The files land in your project. They're yours to edit.

How do I use Dockerfile Check in React?

dockerfile-check-usage.tsx
import { DockerfileCheck } from "@/components/ui/dockerfile-check"

return <DockerfileCheck defaultValue={DOCKERFILE} dockerignore={null} />

What input mistakes does Dockerfile Check catch?

  • A final stage that runs as root
  • Secrets in ARG or ENV, and secret files copied in or carried by COPY --from
  • COPY . before dependency install (slow rebuilds) and a missing .dockerignore
  • apt-get without -y, --no-install-recommends or list cleanup
  • ADD from a URL without --checksum, curl | sh and shell-form CMD

What props does Dockerfile Check accept?

DockerfileCheck props
PropTypeDefault
value

Controlled Dockerfile text.

string—
defaultValue

Initial text when uncontrolled.

string""
onValueChange

Called with the new text on every edit or fix.

(value: string) => void—
dockerignore

The project's .dockerignore: its text, `null` if there is none, or leave out when unknown.

string | null—
label

Visible label; shorthand for `messages.label`.

string—
messages

Every visible string. `{line}`, `{detail}`, `{key}`, `{file}`, `{command}` and friends are filled in.

Partial<DockerfileCheckMessages>—

* required. Also accepts the native props of <textarea> (className, aria-*, data-*…), passed through to it.

How is Dockerfile Check accessible?

  • Visible <label>; aria-invalid and aria-describedby to a role="status" summary
  • Jumping to a finding focuses the textarea at that line
  • After a fix, focus moves to the next fix or back to the field

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Run image scanning and policy checks in CI; this check doesn't see the built image.

  • Static reading of the file; it doesn't build the image or scan installed packages
  • Base-image vulnerabilities are out of scope

What expensive mistakes does Dockerfile Check stop?

Docker image runs as root with secrets

Also known as

dockerfile · docker · buildkit · container · hadolint · multi-stage · devops · image

What dependencies does Dockerfile Check require?

Dockerfile Check facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameDockerfile Check
Registry identifier@bollard/dockerfile-check
Install commandnpx shadcn@latest add @bollard/dockerfile-check
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Dockerfile Check

What form validation mistake does Dockerfile Check catch?

Dockerfile Check prevents docker image runs as root with secrets. Reads a Dockerfile the way BuildKit does and flags images that run as root, bake in secrets or rebuild slowly. Catches: A final stage that runs as root, Secrets in ARG or ENV, and secret files copied in or carried by COPY --from, COPY . before dependency install (slow rebuilds) and a missing .dockerignore, apt-get without -y, --no-install-recommends or list cleanup, ADD from a URL without --checksum, curl | sh and shell-form CMD. Limitation: validate dockerfile-check schemas on backend.

How do I install dockerfile-check with shadcn?

Run `npx shadcn@latest add @bollard/dockerfile-check`. Sources added: registry/default/dockerfile-check/dockerfile-check.tsx, registry/default/dockerfile-check/dockerfile.ts. Package requirements: lucide-react.

What props customize Dockerfile Check?

Dockerfile Check accepts `value`, `defaultValue`, `onValueChange`, `dockerignore`, `label`. Configures dockerfile, docker, buildkit behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of dockerfile-check?

Static reading of the file; it doesn't build the image or scan installed packages. Base-image vulnerabilities are out of scope Server requirement: Run image scanning and policy checks in CI; this check doesn't see the built image.

How does Dockerfile Check meet accessibility guidelines?

Visible <label>; aria-invalid and aria-describedby to a role="status" summary. Jumping to a finding focuses the textarea at that line. After a fix, focus moves to the next fix or back to the field. Minimizes errors: docker runs as root, secret in dockerfile env.

Which components pair with Dockerfile Check?