This repository was archived by the owner on Aug 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -13,12 +13,19 @@ docker image history --no-trunc --format '{{ .CreatedBy }}' "$@" \
1313 # just ignore the default CentOS CMD value (not relevant to our needs)
1414 $0 == "CMD [\"/bin/bash\"]" { next }
1515
16- # ignore the contents of certain copies (notoriously unreliable hashes because they often contain timestamps)
17- $1 == "COPY" && $4 == "/usr/share/kibana/config/kibana.yml" { gsub(/:[0-9a-f]{64}$/, ":filtered-content-hash", $2) }
18-
1916 # remove "org.label-schema.build-date" and "org.opencontainers.image.created" (https://github.com/elastic/dockerfiles/pull/101#pullrequestreview-879623350)
2017 $1 == "LABEL" { gsub(/ (org[.]label-schema[.]build-date|org[.]opencontainers[.]image[.]created)=[^ ]+( [0-9:+-]+)?/, "") }
2118
19+ # remove several buildkit-isms
20+ /# buildkit$/ {
21+ sub(/^RUN[[:space:]]+/, "")
22+ sub(/^\/bin\/sh[[:space:]]+-c[[:space:]]+/, "")
23+ sub(/[[:space:]]*# buildkit$/, "")
24+ }
25+ $1 == "EXPOSE" { gsub(/map\[|\/tcp:\{\}\]/, "") }
26+ # buildkit makes COPY expressions hyper-simplified ("COPY --chown=1000:0 --from=foo /foo /bar" becomes just "COPY /foo /bar" vs "COPY --chown=1000:0 dir:xxxx in /bar")
27+ $1 == "COPY" { $0 = gensub(/^[[:space:]]*(COPY)[[:space:]]+([^[:space:]]+[[:space:]]+)+([^[:space:]]+)[[:space:]]*$/, "\\1 ... \\3", 1) }
28+
2229 # sane and sanitized, print it!
2330 { print }
2431 '
You can’t perform that action at this time.
0 commit comments