From aef51a0697b6906b0545b323426db05d189049fc Mon Sep 17 00:00:00 2001 From: Hans Kratz Date: Mon, 1 Nov 2021 18:32:24 +0100 Subject: [PATCH] Ignore files copied from previous stage when generating hash. --- src/ci/docker/run.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/ci/docker/run.sh b/src/ci/docker/run.sh index b1dacf79d2695..93b4f435d4db7 100755 --- a/src/ci/docker/run.sh +++ b/src/ci/docker/run.sh @@ -50,7 +50,8 @@ if [ -f "$docker_dir/$image/Dockerfile" ]; then # Look for all source files involves in the COPY command copied_files=/tmp/.docker-copied-files.txt rm -f "$copied_files" - for i in $(sed -n -e 's/^COPY \(.*\) .*$/\1/p' "$docker_dir/$image/Dockerfile"); do + for i in $(sed -n -e '/^COPY --from=/! s/^COPY \(.*\) .*$/\1/p' \ + "$docker_dir/$image/Dockerfile"); do # List the file names find "$script_dir/$i" -type f >> $copied_files done