Skip to content

Commit

Permalink
docs: clarify the purpose of the syntax parser directive
Browse files Browse the repository at this point in the history
Signed-off-by: David Karlsson <35727626+dvdksn@users.noreply.github.com>
  • Loading branch information
dvdksn committed Jan 3, 2024
1 parent 8849789 commit 7b98c4e
Showing 1 changed file with 15 additions and 4 deletions.
19 changes: 15 additions & 4 deletions frontend/dockerfile/docs/reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,22 @@ The following parser directives are supported:

<a name="external-implementation-features"><!-- included for deep-links to old section --></a>

This feature is only available when using the [BuildKit](https://docs.docker.com/build/buildkit/)
backend, and is ignored when using the classic builder backend.
Use the `syntax` parser directive to declare the Dockerfile syntax version to
use for the build. If unspecified, BuildKit uses a bundled version of the
Dockerfile frontend. Declaring a syntax version lets you automatically use the
latest Dockerfile version without having to upgrade BuildKit or Docker Engine,
or even use a custom Dockerfile implementation.

Most users will want to set this parser directive to `docker/dockerfile:1`,
which causes BuildKit to pull the latest stable version of the Dockerfile
syntax before the build.

```dockerfile
# syntax=docker/dockerfile:1
```

See [Custom Dockerfile syntax](https://docs.docker.com/build/buildkit/dockerfile-frontend/)
page for more information.
For more information about how the parser directive works, see
[Custom Dockerfile syntax](https://docs.docker.com/build/buildkit/dockerfile-frontend/).

### escape

Expand Down

0 comments on commit 7b98c4e

Please sign in to comment.