Skip to content

Commit 97a7baa

Browse files
authored
Merge pull request #20564 from dvdksn/build-experimental-checks
build: experimental dockerfile rules
2 parents 68c200a + f018aec commit 97a7baa

File tree

2 files changed

+49
-0
lines changed

2 files changed

+49
-0
lines changed

content/manuals/build/checks.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,13 @@ argument with a CSV string of check IDs you want to skip. For example:
212212
$ docker build --check --build-arg "BUILDKIT_DOCKERFILE_CHECK=skip=JSONArgsRecommended,StageNameCasing" .
213213
```
214214

215+
To skip all checks, use the `skip=all` parameter:
216+
217+
```dockerfile {title=Dockerfile}
218+
# syntax=docker/dockerfile:1
219+
# check=skip=all
220+
```
221+
215222
## Combine error and skip parameters for check directives
216223

217224
To both skip specific checks and error on check violations, pass both the
@@ -226,3 +233,43 @@ directive in your Dockerfile or in a build argument. For example:
226233
```console {title="Build argument"}
227234
$ docker build --check --build-arg "BUILDKIT_DOCKERFILE_CHECK=skip=JSONArgsRecommended,StageNameCasing;error=true" .
228235
```
236+
237+
## Experimental checks
238+
239+
Before checks are promoted to stable, they may be available as experimental
240+
checks. Experimental checks are disabled by default. To see the list of
241+
experimental checks available, refer to the [Build checks reference](/reference/build-checks/).
242+
243+
To enable all experimental checks, set the `BUILDKIT_DOCKERFILE_CHECK` build
244+
argument to `experimental=all`:
245+
246+
```console
247+
$ docker build --check --build-arg "BUILDKIT_DOCKERFILE_CHECK=experimental=all" .
248+
```
249+
250+
You can also enable experimental checks in your Dockerfile using the `check`
251+
directive:
252+
253+
```dockerfile {title=Dockerfile}
254+
# syntax=docker/dockerfile:1
255+
# check=experimental=all
256+
```
257+
258+
To selectively enable experimental checks, you can pass a CSV string of the
259+
check IDs you want to enable, either to the `check` directive in your Dockerfile
260+
or as a build argument. For example:
261+
262+
```dockerfile {title=Dockerfile}
263+
# syntax=docker/dockerfile:1
264+
# check=experimental=JSONArgsRecommended,StageNameCasing
265+
```
266+
267+
Note that the `experimental` directive takes precedence over the `skip`
268+
directive, meaning that experimental checks will run regardless of the `skip`
269+
directive you have set. For example, if you set `skip=all` and enable
270+
experimental checks, the experimental checks will still run:
271+
272+
```dockerfile {title=Dockerfile}
273+
# syntax=docker/dockerfile:1
274+
# check=skip=all;experimental=all
275+
```

data/redirects.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,8 @@
225225
- /go/build-summary/
226226
"/desktop/use-desktop/builds/#import-builds":
227227
- /go/builds-import/
228+
"/build/checks/#experimental-checks":
229+
- "/go/build-checks-experimental/"
228230

229231
# Build links (external)
230232
"https://www.docker.com/build-early-access-program/?utm_campaign=onboard-30-customer-zero&utm_medium=in-product-ad&utm_source=desktop_v4":

0 commit comments

Comments
 (0)