From 3eb4892ad2f9a98cb774d362535abf95cbaee134 Mon Sep 17 00:00:00 2001 From: Eoin Farrell Date: Wed, 23 Oct 2024 12:17:19 +0100 Subject: [PATCH] Add/fix references to labs dockerfile version COPY options `--parents` and `--exclude` require dockerfile version `1.7-labs`. Existing table of options only lists required version as `1.7`. Code examples for `--exclude` does not include syntax line, like is included in the code examples for `--parents`. Signed-off-by: Eoin Farrell --- frontend/dockerfile/docs/reference.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/frontend/dockerfile/docs/reference.md b/frontend/dockerfile/docs/reference.md index 9ff0e7a57390..149c1e3b153c 100644 --- a/frontend/dockerfile/docs/reference.md +++ b/frontend/dockerfile/docs/reference.md @@ -1522,8 +1522,8 @@ The available `[OPTIONS]` are: | [`--chown`](#copy---chown---chmod) | | | [`--chmod`](#copy---chown---chmod) | 1.2 | | [`--link`](#copy---link) | 1.4 | -| [`--parents`](#copy---parents) | 1.7 | -| [`--exclude`](#copy---exclude) | 1.7 | +| [`--parents`](#copy---parents) | 1.7-labs | +| [`--exclude`](#copy---exclude) | 1.7-labs | The `COPY` instruction copies new files or directories from `` and adds them to the filesystem of the image at the path ``. Files and directories @@ -1882,6 +1882,9 @@ supporting wildcards and matching using Go's For example, to add all files starting with "hom", excluding files with a `.txt` extension: ```dockerfile +# syntax=docker/dockerfile:1.7-labs +FROM scratch + COPY --exclude=*.txt hom* /mydir/ ``` @@ -1891,6 +1894,9 @@ even if the files paths match the pattern specified in ``. To add all files starting with "hom", excluding files with either `.txt` or `.md` extensions: ```dockerfile +# syntax=docker/dockerfile:1.7-labs +FROM scratch + COPY --exclude=*.txt --exclude=*.md hom* /mydir/ ```