Get the internal CA into the buildkit container via registry
ci/woodpecker/pr/pre-commit Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful

The buildkit_config setting does not exist in the plugin-docker-buildx build
we run: the binary has no PLUGIN_BUILDKIT_CONFIG, so the block was dead YAML
and `docker buildx create` ran without --config, leaving the spawned buildkit
container with no internal CA. The plugin only writes a buildkit.toml
(pointing at /etc/docker/certs.d/<registry>/ca.crt) when `registry` is set.

Set registry on the build step, drop the dead block from every step, and
fail ci/check-distros.sh when a matrix value restating a distro.env key
drifts from it.
This commit is contained in:
2026-09-27 22:19:24 +10:00
parent 06b159694c
commit 83beaff2db
3 changed files with 26 additions and 9 deletions
+4 -3
View File
@@ -13,15 +13,16 @@ steps:
- name: build
image: "artifactapi.k8s.syd1.au.unkin.net/docker-internal/plugin-docker-buildx:latest"
settings:
# registry is what gets the internal CA into the buildkit container: the plugin
# writes a buildkit.toml pointing at /etc/docker/certs.d/<registry>/ca.crt only
# when it is set. The plugin has no buildkit_config setting.
registry: artifactapi.k8s.syd1.au.unkin.net
repo: "artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder"
target: image
dry_run: true
build_args:
BASE_IMAGE_NAME: "${BASE_IMAGE_NAME}"
DISTRO: "${DISTRO}"
buildkit_config: |
[registry."artifactapi.k8s.syd1.au.unkin.net"]
ca = ["/etc/docker/certs.d/artifactapi.k8s.syd1.au.unkin.net/ca.crt"]
backend_options:
kubernetes:
serviceAccountName: default
+3 -6
View File
@@ -14,15 +14,15 @@ steps:
- name: docker
image: "artifactapi.k8s.syd1.au.unkin.net/docker-internal/plugin-docker-buildx:latest"
settings:
# registry is what gets the internal CA into the buildkit container: the plugin
# writes a buildkit.toml pointing at /etc/docker/certs.d/<registry>/ca.crt only
# when it is set. The plugin has no buildkit_config setting.
registry: artifactapi.k8s.syd1.au.unkin.net
repo: "artifactapi.k8s.syd1.au.unkin.net/docker-internal/gobuilder"
target: image
build_args:
BASE_IMAGE_NAME: "${BASE_IMAGE_NAME}"
DISTRO: "${DISTRO}"
buildkit_config: |
[registry."artifactapi.k8s.syd1.au.unkin.net"]
ca = ["/etc/docker/certs.d/artifactapi.k8s.syd1.au.unkin.net/ca.crt"]
tags:
- "${CI_COMMIT_TAG##v}-${TAG_SUFFIX}"
backend_options:
@@ -48,9 +48,6 @@ steps:
build_args:
BASE_IMAGE_NAME: "${BASE_IMAGE_NAME}"
DISTRO: "${DISTRO}"
buildkit_config: |
[registry."artifactapi.k8s.syd1.au.unkin.net"]
ca = ["/etc/docker/certs.d/artifactapi.k8s.syd1.au.unkin.net/ca.crt"]
tags:
- "${CI_COMMIT_TAG##v}"
- latest
+19
View File
@@ -14,6 +14,25 @@ for d in distros/*/; do
done
for wf in "${WORKFLOWS[@]}"; do
grep -q "DISTRO: ${n}\$" "$wf" || { echo "${wf}: distro ${n} missing from matrix"; fail=1; }
# A matrix entry that restates a distro.env key must not drift from it — a stale
# BASE_IMAGE here silently overrides distro.env for every CI build.
while IFS='=' read -r k v; do
[ -n "$k" ] || continue
grep -q "^${k}=" "${d}distro.env" || continue
ev=$(sed -n "s/^${k}=//p" "${d}distro.env" | head -1 | sed 's/^"//;s/"$//')
[ "$v" = "$ev" ] || { echo "${wf}: matrix ${k}=\"${v}\" for ${n} disagrees with ${d}distro.env (\"${ev}\")"; fail=1; }
done <<EOF
$(awk -v d="$n" '
$0 ~ "^[[:space:]]*-[[:space:]]+DISTRO:[[:space:]]*"d"[[:space:]]*$" { inb=1; next }
inb && /^[[:space:]]*-/ { inb=0 }
inb && match($0, /^[[:space:]]+[A-Z_]+:/) {
k=$1; sub(/:$/,"",k)
v=$0; sub(/^[[:space:]]*[A-Z_]+:[[:space:]]*/,"",v); gsub(/^"|"$/,"",v)
print k "=" v
}
' "$wf")
EOF
done
done