From 3b5dfb3fb483c0a9cc6bd623f30b2a4d915b0453 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Mon, 14 Mar 2022 19:24:07 -0700 Subject: [PATCH 1/2] docs: make sure all named context examples use 1.4 Signed-off-by: Tonis Tiigi --- docs/reference/buildx_build.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/reference/buildx_build.md b/docs/reference/buildx_build.md index b0f6c6ea..ec9112d9 100644 --- a/docs/reference/buildx_build.md +++ b/docs/reference/buildx_build.md @@ -129,6 +129,7 @@ $ docker buildx build --build-context project=path/to/project/source . ``` ```Dockerfile +#syntax=docker/dockerfile:1.4 FROM alpine COPY --from=project myfile / ``` From 1378c616d6f0a74a6bbb2d3183e898a4e2f985a0 Mon Sep 17 00:00:00 2001 From: CrazyMax Date: Thu, 18 Aug 2022 12:00:40 +0200 Subject: [PATCH 2/2] docs: missing syntax directive Signed-off-by: CrazyMax --- README.md | 4 +++- docs/reference/buildx_build.md | 14 +++++++------- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index f43d94de..882374fe 100644 --- a/README.md +++ b/README.md @@ -123,7 +123,8 @@ On Windows: 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 +```dockerfile +# syntax=docker/dockerfile:1 FROM docker COPY --from=docker/buildx-bin /buildx /usr/libexec/docker/cli-plugins/docker-buildx RUN docker buildx version @@ -298,6 +299,7 @@ inside your Dockerfile and can be leveraged by the processes running as part of your build. ```dockerfile +# syntax=docker/dockerfile:1 FROM --platform=$BUILDPLATFORM golang:alpine AS build ARG TARGETPLATFORM ARG BUILDPLATFORM diff --git a/docs/reference/buildx_build.md b/docs/reference/buildx_build.md index ec9112d9..405fc512 100644 --- a/docs/reference/buildx_build.md +++ b/docs/reference/buildx_build.md @@ -128,8 +128,8 @@ $ docker buildx build --build-context project=path/to/project/source . # docker buildx build --build-context project=https://github.com/myuser/project.git . ``` -```Dockerfile -#syntax=docker/dockerfile:1.4 +```dockerfile +# syntax=docker/dockerfile:1 FROM alpine COPY --from=project myfile / ``` @@ -142,10 +142,10 @@ Source an image from a local [OCI layout compliant directory](https://github.com $ docker buildx build --build-context foo=oci-layout:///path/to/local/layout@sha256:abcd12345 . ``` -```Dockerfile +```dockerfile +# syntax=docker/dockerfile:1 FROM alpine RUN apk add git - COPY --from=foo myfile / FROM foo @@ -469,7 +469,7 @@ Attribute keys: - `src`, `source` - Secret filename. `id` used if unset. ```dockerfile -# syntax=docker/dockerfile:1.4 +# syntax=docker/dockerfile:1 FROM python:3 RUN pip install awscli RUN --mount=type=secret,id=aws,target=/root/.aws/credentials \ @@ -488,7 +488,7 @@ Attribute keys: - `env` - Secret environment variable. `id` used if unset, otherwise will look for `src`, `source` if `id` unset. ```dockerfile -# syntax=docker/dockerfile:1.4 +# syntax=docker/dockerfile:1 FROM node:alpine RUN --mount=type=bind,target=. \ --mount=type=secret,id=SECRET_TOKEN \ @@ -520,7 +520,7 @@ authentication (e.g., cloning a private repository). Example to access Gitlab using an SSH agent socket: ```dockerfile -# syntax=docker/dockerfile:1.4 +# syntax=docker/dockerfile:1 FROM alpine RUN apk add --no-cache openssh-client RUN mkdir -p -m 0700 ~/.ssh && ssh-keyscan gitlab.com >> ~/.ssh/known_hosts