Skip to content
This repository was archived by the owner on Aug 5, 2025. It is now read-only.

Commit f858371

Browse files
committed
Ignore buildkit-isms during build/history check
1 parent 8ecac06 commit f858371

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

.github/workflows/history.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,16 @@ docker image history --no-trunc --format '{{ .CreatedBy }}' "$@" \
1313
# remove "org.label-schema.build-date" and "org.opencontainers.image.created" (https://github.com/elastic/dockerfiles/pull/101#pullrequestreview-879623350)
1414
$1 == "LABEL" { gsub(/ (org[.]label-schema[.]build-date|org[.]opencontainers[.]image[.]created)=[^ ]+( [0-9:+-]+)?/, "") }
1515
16+
# remove several buildkit-isms
17+
/# buildkit$/ {
18+
sub(/^RUN[[:space:]]+/, "")
19+
sub(/^\/bin\/sh[[:space:]]+-c[[:space:]]+/, "")
20+
sub(/[[:space:]]*# buildkit$/, "")
21+
}
22+
$1 == "EXPOSE" { gsub(/map\[|\/tcp:\{\}|\]/, "") }
23+
# 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")
24+
$1 == "COPY" { $0 = gensub(/^[[:space:]]*(COPY)[[:space:]]+([^[:space:]]+[[:space:]]+)+([^[:space:]]+)[[:space:]]*$/, "\\1 ... \\3", 1) }
25+
1626
# in logstash, Elastic builds pull artifacts from "http://localhost:8000" instead of "https://artifacts.elastic.co/downloads/logstash"
1727
/localhost:8000\/logstash/ { gsub(/http:\/\/localhost:8000\/logstash/, "https://artifacts.elastic.co/downloads/logstash/logstash") }
1828

0 commit comments

Comments
 (0)