| 1 |
--- |
| 2 |
title: Build checks |
| 3 |
description: | |
| 4 |
BuildKit has built-in support for analyzing your build configuration based on |
| 5 |
a set of pre-defined rules for enforcing Dockerfile and building best |
| 6 |
practices. |
| 7 |
keywords: buildkit, linting, dockerfile, frontend, rules |
| 8 |
--- |
| 9 |
|
| 10 |
BuildKit has built-in support for analyzing your build configuration based on a |
| 11 |
set of pre-defined rules for enforcing Dockerfile and building best practices. |
| 12 |
Adhering to these rules helps avoid errors and ensures good readability of your |
| 13 |
Dockerfile. |
| 14 |
|
| 15 |
Checks run as a build invocation, but instead of producing a build output, it |
| 16 |
performs a series of checks to validate that your build doesn't violate any of |
| 17 |
the rules. To run a check, use the `--check` flag: |
| 18 |
|
| 19 |
```console |
| 20 |
$ docker build --check . |
| 21 |
``` |
| 22 |
|
| 23 |
To learn more about how to use build checks, see |
| 24 |
[Checking your build configuration](https://docs.docker.com/build/checks/). |
| 25 |
|
| 26 |
<table> |
| 27 |
<thead> |
| 28 |
<tr> |
| 29 |
<th>Name</th> |
| 30 |
<th>Description</th> |
| 31 |
</tr> |
| 32 |
</thead> |
| 33 |
<tbody> |
| 34 |
{{- range .Rules }} |
| 35 |
<tr> |
| 36 |
<td><a href="./{{ .PageName }}/">{{ .Name }}{{- if .Experimental }} (experimental){{- end}}</a></td> |
| 37 |
<td>{{ .Description }}</td> |
| 38 |
</tr> |
| 39 |
{{- end }} |
| 40 |
</tbody> |
| 41 |
</table> |