Skip to content

Commit a4d3ee6

Browse files
committed
Set BASHBREW_BUILDKIT_SYNTAX and respect "Builder:" in GitHub Actions scripts
1 parent f09bb95 commit a4d3ee6

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

scripts/github-actions/generate.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ for tag in $tags; do
5555
"tags": {{- json ($.Tags namespace false $e) -}},
5656
"directory": {{- json ($e.ArchDirectory $arch) -}},
5757
"file": {{- json ($e.ArchFile $arch) -}},
58+
"builder": {{- json ($e.ArchBuilder $arch) -}}
5859
"constraints": {{- json $e.Constraints -}},
5960
"froms": {{- json ($.ArchDockerFroms $arch $e) -}}
6061
{{- "}" -}}
@@ -77,7 +78,14 @@ for tag in $tags; do
7778
runs: {
7879
build: (
7980
[
80-
"docker build"
81+
# https://github.com/docker-library/bashbrew/pull/43
82+
if .builder == "classic" or .builder == "" then
83+
"DOCKER_BUILDKIT=0 docker build"
84+
elif .builder == "buildkit" then
85+
"docker buildx build --progress plain --build-arg BUILDKIT_SYNTAX=\"$BASHBREW_BUILDKIT_SYNTAX\"
86+
else
87+
"echo >&2 " + ("error: unknown/unsupported builder: " + .builder | @sh) + "\nexit 1\n#"
88+
end
8189
]
8290
+ (
8391
.tags
@@ -165,6 +173,7 @@ strategy="$(
165173
end
166174
),
167175
"git clone --depth 1 https://github.com/docker-library/official-images.git -b master ~/oi",
176+
"echo BASHBREW_BUILDKIT_SYNTAX=\"$(< ~/oi/.bashbrew-buildkit-syntax)\" >> \"$GITHUB_ENV\"",
168177
"# create a dummy empty image/layer so we can --filter since= later to get a meaningful image list",
169178
"{ echo FROM " + (
170179
if .os | startswith("windows-") then

0 commit comments

Comments
 (0)