← All notes

Docker build checks: lint a Dockerfile before or during a build

Answer: Docker build checks validate a Dockerfile and build options before or during a build, as linting or a dry run.

How checks run

Build checks arrived in Dockerfile 1.8. They validate build configuration and run a series of checks before the build executes.

Think of them as linting for the Dockerfile and build options, or as a dry-run mode.

With checks enabled, Docker inspects the Dockerfile and options you pass and reports issues instead of only executing the steps.

Checks help with validating your Dockerfile and build options before you run a build, and with identifying potential issues or anti-patterns.

Support starts at Buildx 0.15.0, docker/build-push-action 6.6.0, and docker/bake-action 5.6.0.

A normal build runs the checks by default and prints violations in the output. One example is JSONArgsRecommended when a CMD instruction does not use JSON array syntax.

With --debug, the output includes a documentation link for the check, plus a snippet of the Dockerfile.

docker build --check . runs the checks without executing the build steps.

Failing or skipping checks

By default, violations are reported as warnings and the process exits 0.

A # check=error=true directive in the Dockerfile makes the build fail after the checks run, before the actual build starts.

The same error setting can be passed on the CLI with the BUILDKIT_DOCKERFILE_CHECK build argument.

A # check=skip=ID,ID directive, or the same CSV list in BUILDKIT_DOCKERFILE_CHECK, skips named checks. skip=all skips every check.

You can combine skip and error in one directive or build argument, separated by a semicolon.

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Build checks; Docker, Inc., Build checks (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Docker, Inc., Build checks; Docker, Inc., Build checks (source). Apache-2.0 (https://raw.githubusercontent.com/docker/docs/main/LICENSE). Copyright Docker, Inc.

Cite this

Permanent ID: iil:note:dc011nra

iinventedlight. 2026. "Docker build checks: lint a Dockerfile before or during a build." iinventedlight Library, iil:note:dc011nra, version of 2026-11-27. https://iinventedlight.com/library/notes/docker-build-checks/. License: CC-BY-4.0.

@misc{iil_note_dc011nra,
  author = {{iinventedlight}},
  title = {{Docker build checks: lint a Dockerfile before or during a build}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-27},
  url = {https://iinventedlight.com/library/notes/docker-build-checks/},
  note = {Permanent ID iil:note:dc011nra. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/docker-build-checks.md.