diff --git a/build/building/cache/index.md b/build/building/cache/index.md index 608f203fd3..aaf8dcb9cd 100644 --- a/build/building/cache/index.md +++ b/build/building/cache/index.md @@ -22,6 +22,7 @@ Have a look at the following example, which shows a simple Dockerfile for a program written in C. ```dockerfile +# syntax=docker/dockerfile:1 FROM ubuntu:latest RUN apt-get update && apt-get install -y build-essentials @@ -86,6 +87,7 @@ Consider the following example. A Dockerfile snippet that runs a JavaScript build from the source files in the current directory: ```dockerfile +# syntax=docker/dockerfile:1 FROM node WORKDIR /app COPY . . # Copy over all files in the current directory @@ -103,6 +105,7 @@ the dependencies. Finally, copy over the project source code, which is subject to frequent change. ```dockerfile +# syntax=docker/dockerfile:1 FROM node WORKDIR /app COPY package.json yarn.lock . # Copy package management files @@ -225,6 +228,8 @@ illustrates building a simple web server that serves HTML from your `docs` directory in Git: ```dockerfile +# syntax=docker/dockerfile:1 + # stage 1 FROM alpine as git RUN apk add git diff --git a/build/building/context.md b/build/building/context.md index 58ad1f0b34..98e500bcfc 100644 --- a/build/building/context.md +++ b/build/building/context.md @@ -41,6 +41,7 @@ $ docker build . With the following Dockerfile: ```dockerfile +# syntax=docker/dockerfile:1 FROM busybox WORKDIR /src COPY foo . @@ -64,6 +65,7 @@ files required by the `COPY` instructions, in this case `foo`. In some cases you may want to send the entire context: ```dockerfile +# syntax=docker/dockerfile:1 FROM busybox WORKDIR /src COPY . . diff --git a/build/buildkit/configure.md b/build/buildkit/configure.md index 015e4de922..a694341385 100644 --- a/build/buildkit/configure.md +++ b/build/buildkit/configure.md @@ -148,6 +148,8 @@ rel="noopener" class="_"} in BuildKit as an example. Feel free to include your own CNI configuration. ```dockerfile +# syntax=docker/dockerfile:1 + ARG BUILDKIT_VERSION=v{{ site.buildkit_version }} ARG CNI_VERSION=v1.0.1 diff --git a/build/buildx/install.md b/build/buildx/install.md index 0f33bd4012..5979dd32c3 100644 --- a/build/buildx/install.md +++ b/build/buildx/install.md @@ -20,6 +20,7 @@ Here is how to install and use Buildx inside a Dockerfile through the [`docker/buildx-bin`](https://hub.docker.com/r/docker/buildx-bin) image: ```dockerfile +# syntax=docker/dockerfile:1 FROM docker COPY --from=docker/buildx-bin:latest /buildx /usr/libexec/docker/cli-plugins/docker-buildx RUN docker buildx version