From 8174c1b3a93f066f1534a0f49dc469796781bfdb Mon Sep 17 00:00:00 2001 From: OddBloke Date: Thu, 3 Jul 2014 12:55:21 +0100 Subject: [PATCH] Explain ADD invalidation more accurately And also move it in to the `ADD` section, rather than being hidden in the `RUN` section. Docker-DCO-1.1-Signed-off-by: Daniel Watkins (github: OddBloke) Upstream-commit: 20a77aeeb8855ca0189fe9e3292d92b165b08905 Component: engine --- components/engine/docs/sources/reference/builder.md | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/components/engine/docs/sources/reference/builder.md b/components/engine/docs/sources/reference/builder.md index 91190933c9..da7f3ebff2 100644 --- a/components/engine/docs/sources/reference/builder.md +++ b/components/engine/docs/sources/reference/builder.md @@ -169,9 +169,8 @@ will be reused during the next build. The cache for `RUN` instructions can be invalidated by using the `--no-cache` flag, for example `docker build --no-cache`. -The first encountered `ADD` instruction will invalidate the cache for all -following instructions from the 'Dockerfile' if the contents of the context -have changed. This will also invalidate the cache for `RUN` instructions. +The cache for `RUN` instructions can be invalidated by `ADD` instructions. See +[below](#add) for details. ### Known Issues (RUN) @@ -285,6 +284,11 @@ In the case where `` is a remote file URL, the destination will have permis > or use another tool from within the container as ADD does not support > authentication. +> **Note**: +> The first encountered `ADD` instruction will invalidate the cache for all +> following instructions from the Dockerfile if the contents of `` have +> changed. This includes invalidating the cache for `RUN` instructions. + The copy obeys the following rules: - The `` path must be inside the *context* of the build;