Skip to content

Set BASHBREW_BUILDKIT_SYNTAX and respect "Builder:" in GitHub Actions scripts #52

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 14, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion scripts/github-actions/generate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ for tag in $tags; do
"tags": {{- json ($.Tags namespace false $e) -}},
"directory": {{- json ($e.ArchDirectory $arch) -}},
"file": {{- json ($e.ArchFile $arch) -}},
"builder": {{- json ($e.ArchBuilder $arch) -}}
"constraints": {{- json $e.Constraints -}},
"froms": {{- json ($.ArchDockerFroms $arch $e) -}}
{{- "}" -}}
Expand All @@ -77,7 +78,14 @@ for tag in $tags; do
runs: {
build: (
[
"docker build"
# https://github.com/docker-library/bashbrew/pull/43
if .builder == "classic" or .builder == "" then
"DOCKER_BUILDKIT=0 docker build"
elif .builder == "buildkit" then
"docker buildx build --progress plain --build-arg BUILDKIT_SYNTAX=\"$BASHBREW_BUILDKIT_SYNTAX\"
else
"echo >&2 " + ("error: unknown/unsupported builder: " + .builder | @sh) + "\nexit 1\n#"
end
]
+ (
.tags
Expand Down Expand Up @@ -165,6 +173,10 @@ strategy="$(
end
),
"git clone --depth 1 https://github.com/docker-library/official-images.git -b master ~/oi",

# https://github.com/docker-library/bashbrew/pull/43
"echo BASHBREW_BUILDKIT_SYNTAX=\"$(< ~/oi/.bashbrew-buildkit-syntax)\" >> \"$GITHUB_ENV\"",

"# create a dummy empty image/layer so we can --filter since= later to get a meaningful image list",
"{ echo FROM " + (
if .os | startswith("windows-") then
Expand Down