Browse Source

diff-pr: ADD/COPY enumerate full list of options (#16945)

--from an option we just want to move on from as its in an
another layer.

Other options don't map to files.

Once we get a non-option they all are files.

ref:
* https://docs.docker.com/reference/dockerfile/#add
* https://docs.docker.com/reference/dockerfile/#copy
Daniel Black 1 year ago
parent
commit
8cf0837e1e
1 changed files with 9 additions and 1 deletions
  1. 9 1
      diff-pr.sh

+ 9 - 1
diff-pr.sh

@@ -249,7 +249,15 @@ copy-tar() {
 					if ($i ~ /^--from=/) {
 						next
 					}
-					if ($i !~ /^--chown=/) {
+					# COPY and ADD options
+					if ($i ~ /^--(chown|chmod|link|parents|exclude)=/) {
+						continue
+					}
+					# additional ADD options
+					if ($i ~ /^--(keep-git-dir|checksum)=/) {
+						continue
+					}
+					for ( ; i < NF; i++) {
 						print $i
 					}
 				}