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>
This commit is contained in:
Maciej Kalisz 2019-11-11 20:56:31 +01:00 committed by Sebastiaan van Stijn
parent 452c25cfec
commit ef414633d6
No known key found for this signature in database
GPG Key ID: 76698F39D527CE8C
1 changed files with 11 additions and 3 deletions

View File

@ -743,8 +743,7 @@ flag, for example `docker build --no-cache`.
See the [`Dockerfile` Best Practices See the [`Dockerfile` Best Practices
guide](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/) for more information. guide](https://docs.docker.com/engine/userguide/eng-image/dockerfile_best-practices/) for more information.
The cache for `RUN` instructions can be invalidated by `ADD` instructions. See The cache for `RUN` instructions can be invalidated by [`ADD`](#add) and [`COPY`](#copy) instructions.
[below](#add) for details.
### Known issues (RUN) ### Known issues (RUN)
@ -1114,7 +1113,7 @@ does not support authentication.
> following instructions from the Dockerfile if the contents of `<src>` have > following instructions from the Dockerfile if the contents of `<src>` have
> changed. This includes invalidating the cache for `RUN` instructions. > changed. This includes invalidating the cache for `RUN` instructions.
> See the [`Dockerfile` Best Practices > See the [`Dockerfile` Best Practices
guide](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/) guide  Leverage build cache](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache)
> for more information. > for more information.
@ -1303,6 +1302,15 @@ image with the same name is attempted to be used instead.
- If `<dest>` doesn't exist, it is created along with all missing directories - If `<dest>` doesn't exist, it is created along with all missing directories
in its path. in its path.
> **Note**
>
> The first encountered `COPY` instruction will invalidate the cache for all
> following instructions from the Dockerfile if the contents of `<src>` have
> changed. This includes invalidating the cache for `RUN` instructions.
> See the [`Dockerfile` Best Practices
guide  Leverage build cache](https://docs.docker.com/develop/develop-images/dockerfile_best-practices/#leverage-build-cache)
> for more information.
## ENTRYPOINT ## ENTRYPOINT