Skip to content
This repository was archived by the owner on Oct 13, 2023. It is now read-only.

Commit 55cac16

Browse files
mdkalishthaJeztah
authored andcommitted
Update dead link and add missing info on COPY
1. Fix dead URL to [Dockerfile best practices](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache). 2. Add missing information about cache invalidation by `COPY`. It works in the same way as in the case of `ADD`. Informing only about the `ADD`s behavior is misleading as one can infer that these two directives differ in this regard. 3. Add missing info on RUN cache invalidation by COPY Signed-off-by: Maciej Kalisz <maciej.d.kalisz@gmail.com> (cherry picked from commit ef414633d6365b84693dc32b8dcc3ef7639d64cc) Signed-off-by: Sebastiaan van Stijn <github@gone.nl> Upstream-commit: e06fc01c1bfb860c9ef1db32f5497cac89e8ec76 Component: cli
1 parent 50d22f0 commit 55cac16

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

components/cli/docs/reference/builder.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -743,8 +743,7 @@ flag, for example `docker build --no-cache`.
743743
See the [`Dockerfile` Best Practices
744744
guide](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/) for more information.
745745
746-
The cache for `RUN` instructions can be invalidated by `ADD` instructions. See
747-
[below](#add) for details.
746+
The cache for `RUN` instructions can be invalidated by [`ADD`](#add) and [`COPY`](#copy) instructions.
748747
749748
### Known issues (RUN)
750749
@@ -1114,7 +1113,7 @@ does not support authentication.
11141113
> following instructions from the Dockerfile if the contents of `<src>` have
11151114
> changed. This includes invalidating the cache for `RUN` instructions.
11161115
> See the [`Dockerfile` Best Practices
1117-
guide](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/)
1116+
guide – Leverage build cache](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache)
11181117
> for more information.
11191118
11201119
@@ -1303,6 +1302,15 @@ image with the same name is attempted to be used instead.
13031302
13041303
- If `<dest>` doesn't exist, it is created along with all missing directories
13051304
in its path.
1305+
1306+
> **Note**
1307+
>
1308+
> The first encountered `COPY` instruction will invalidate the cache for all
1309+
> following instructions from the Dockerfile if the contents of `<src>` have
1310+
> changed. This includes invalidating the cache for `RUN` instructions.
1311+
> See the [`Dockerfile` Best Practices
1312+
guide – Leverage build cache](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache)
1313+
> for more information.
13061314
13071315
## ENTRYPOINT
13081316

0 commit comments

Comments
 (0)