Use build-arg for Dockerfile registry to avoid DERP relay failures #76
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "73-kaniko-build-arg-registry"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
ARG REGISTRYdefaulting to external URLbuild_args, pulling base images directly instead of through the DERP relaydocker buildstill works without passing--build-arg(defaults to external)Closes #73
Changes
Dockerfile: AddARG REGISTRY=harbor.tail5b443a.ts.net, use${REGISTRY}in both FROM statements.woodpecker.yaml: Addbuild_args: "REGISTRY=harbor.harbor.svc.cluster.local"to Kaniko stepTest Plan
harbor.harbor.svc.cluster.local, notharbor.tail5b443a.ts.netdocker build .still works without--build-argReview Checklist
Related Notes
ldraney/landscaping-assistant #73— Kaniko DERP relay fixlandscaping-assistant— projectPR #76 Review
DOMAIN REVIEW
Tech stack identified: Dockerfile (multi-stage build), Woodpecker CI (Kaniko plugin), YAML pipeline config.
Dockerfile changes (lines 4-5, 19-20):
ARG REGISTRY=harbor.tail5b443a.ts.netdeclared twice -- once before eachFROMstatement. This is correct and required by Docker's multi-stage build semantics:ARGdeclarations beforeFROMare scoped to the build-stage preamble and reset after eachFROM. Each stage that needs the arg must redeclare it. Well done.harbor.tail5b443a.ts.netpreserves localdocker build .compatibility without requiring--build-arg. Correct.${REGISTRY}interpolation inFROMlines is syntactically valid for BuildKit and Kaniko.Woodpecker changes (line 50):
build_args: "REGISTRY=harbor.harbor.svc.cluster.local"passes the internal cluster-local Harbor URL to Kaniko, which overrides the default. This avoids routing image pulls through the Tailscale DERP relay. Correct approach.build_argsvalue is consistent with the existingregistryandinsecure-registrysettings on lines 47 and 49. Good internal consistency.Observation -- hardcoded registry in other files:
docker-compose.yml(line 12) still hardcodesharbor.tail5b443a.ts.net/library/ruby-rails-build:latestfor the devwebservice image. This is acceptable since docker-compose runs locally and needs the external Tailscale URL. Not a bug, but worth noting for future parameterization if the registry URL ever changes..woodpecker.yamllint and test steps (lines 17, 29) also hardcodeharbor.tail5b443a.ts.net/library/ruby-rails-build:latestas their runner images. These are pulled by the Woodpecker agent (not Kaniko), so the build-arg pattern does not apply to them. If the DERP relay issue also affects agent image pulls, those would need a separate fix (image pull policy or agent-level mirror config). This is out of scope for this PR.No secrets exposed: The registry URLs are infrastructure endpoints, not credentials. Harbor credentials are correctly sourced from
from_secretreferences (lines 57-59).BLOCKERS
None.
This is a CI/infrastructure-only change to Dockerfile build args and pipeline config. No application code, no user input handling, no new functionality requiring tests. The BLOCKER criteria (test coverage for new functionality, unvalidated input, secrets, DRY auth violations) do not apply.
NITS
Consistency nit (non-blocking): The
ARG REGISTRYdefault includes the hostname but not the scheme. This is correct for Docker image references, but a brief inline comment like# Override via --build-arg REGISTRY=... for cluster-internal pullswould help future readers understand why the ARG exists. Very minor.Repeated default value: The default
harbor.tail5b443a.ts.netappears in twoARGdeclarations. If the external URL ever changes, both must be updated. A single-source-of-truth pattern is not possible here due to Docker'sARGscoping rules acrossFROMboundaries, so this is inherent to the design. No action needed, just documenting for awareness.SOP COMPLIANCE
73-kaniko-build-arg-registryfollows{issue-number}-{kebab-case-purpose}from_secretDockerfileand.woodpecker.yamlmodified, both directly relevantPROCESS OBSERVATIONS
build_argssyntax differs from expectations, which the Test Plan correctly covers.VERDICT: APPROVED