From 9152bf265ee53a60a6d141cc294bf14cd899c7f9 Mon Sep 17 00:00:00 2001 From: Tonis Tiigi Date: Mon, 27 Jul 2020 15:56:23 -0700 Subject: [PATCH 1/2] =?UTF-8?q?docs:=20remove=20docs=20for=20=E2=80=94-fro?= =?UTF-8?q?m=3Dindex?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Naming stages is the preferred method for using multi-stage builds. Signed-off-by: Tonis Tiigi (cherry picked from commit 5dd9bd4c2cead98c1b183402a172dd0d488703ae) Signed-off-by: Sebastiaan van Stijn --- docs/reference/builder.md | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/docs/reference/builder.md b/docs/reference/builder.md index 417ffb5ba9..d5a44c382b 100644 --- a/docs/reference/builder.md +++ b/docs/reference/builder.md @@ -666,7 +666,7 @@ the [*Public Repositories*](https://docs.docker.com/engine/tutorials/dockerrepos instructions. - Optionally a name can be given to a new build stage by adding `AS name` to the `FROM` instruction. The name can be used in subsequent `FROM` and - `COPY --from=` instructions to refer to the image built in this stage. + `COPY --from=` instructions to refer to the image built in this stage. - The `tag` or `digest` values are optional. If you omit either of them, the builder assumes a `latest` tag by default. The builder returns an error if it cannot find the `tag` value. @@ -1311,12 +1311,11 @@ no lookup and does not depend on container root filesystem content. > If you build using STDIN (`docker build - < somefile`), there is no > build context, so `COPY` can't be used. -Optionally `COPY` accepts a flag `--from=` that can be used to set +Optionally `COPY` accepts a flag `--from=` that can be used to set the source location to a previous build stage (created with `FROM .. AS `) -that will be used instead of a build context sent by the user. The flag also -accepts a numeric index assigned for all previous build stages started with -`FROM` instruction. In case a build stage with a specified name can't be found an -image with the same name is attempted to be used instead. +that will be used instead of a build context sent by the user. In case a build +stage with a specified name can't be found an image with the same name is +attempted to be used instead. `COPY` obeys the following rules: From 5c5486d910a6f2a5e013970d715cd77b92ad821c Mon Sep 17 00:00:00 2001 From: eyherabh Date: Fri, 17 Jul 2020 22:18:02 +0300 Subject: [PATCH 2/2] Replaces ADD with COPY in the COPY section Possibly a typo from reusing text from the ADD section. Signed-off-by: Hugo Gabriel Eyherabide (cherry picked from commit 86cbe28510ad7cc91694fec520ad8c33f7cd844f) Signed-off-by: Sebastiaan van Stijn --- docs/reference/builder.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/reference/builder.md b/docs/reference/builder.md index d5a44c382b..0b025f15c6 100644 --- a/docs/reference/builder.md +++ b/docs/reference/builder.md @@ -1276,11 +1276,11 @@ COPY test.txt /absoluteDir/ When copying files or directories that contain special characters (such as `[` and `]`), you need to escape those paths following the Golang rules to prevent -them from being treated as a matching pattern. For example, to add a file +them from being treated as a matching pattern. For example, to copy a file named `arr[0].txt`, use the following; ```dockerfile -ADD arr[[]0].txt /mydir/ +COPY arr[[]0].txt /mydir/ ``` All new files and directories are created with a UID and GID of 0, unless the