Skip to content

fix: migrate Dockerfile lint stages to test-tools:local (#106)#25

Merged
ycpss91255 merged 3 commits into
mainfrom
fix/dockerfile-test-tools-migration
Apr 24, 2026
Merged

fix: migrate Dockerfile lint stages to test-tools:local (#106)#25
ycpss91255 merged 3 commits into
mainfrom
fix/dockerfile-test-tools-migration

Conversation

@ycpss91255
Copy link
Copy Markdown
Contributor

Summary

Closes template issue #106 for this repo.

Inline bats-src / bats-extensions / lint-tools stages in Dockerfile hardcoded linux.x86_64 / Linux-x86_64 download URLs, so on arm64 hosts (Jetson, Graviton) they pulled unusable binaries and ./build.sh test broke at shellcheck -S warning /lint/*.sh. ./build.sh devel kept working because devel doesn't need lint tools.

Migrated to template's pre-built arch-aware test-tools:local image (template/dockerfile/Dockerfile.test-tools keys off BuildKit's TARGETARCH). ./build.sh and build-worker.yaml already build test-tools:local before the main build.

  • 3 inline stages deleted (19 lines)
  • 4 COPY --from=... lines switched to --from=test-tools:local
  • bats-extensions COPY dropped (test-tools:local bundles bats-support / bats-assert under /usr/lib/bats)

Net: -17 lines.

Test plan

  • ./build.sh --no-env test on amd64 — 28/28 smoke tests pass, lint green
  • CI call-docker-build / build (linux/amd64) green
  • On Jetson: git pull && ./build.sh test exercises the arm64 path

Notes

  • dev_bridge.sh (untracked local WIP helper at repo root) left alone per maintainer instruction.

Inline bats-src / bats-extensions / lint-tools stages had hardcoded
linux.x86_64 / Linux-x86_64 download URLs. On arm64 hosts (Jetson,
Graviton) they pulled unusable binaries; the `test` stage then exited
at `shellcheck -S warning /lint/*.sh`. `./build.sh devel` still
worked because devel doesn't need lint tools, but `./build.sh test`
and the CI `docker-build` check broke on arm64.

Template's `Dockerfile.test-tools` builds an arch-aware
shellcheck + hadolint + bats bundle (keyed off BuildKit's TARGETARCH).
`./build.sh` and `build-worker.yaml` already build `test-tools:local`
before the main build, so consumers just COPY from it.

Delete 19 lines of inline stages; switch 4 COPY --from=... lines to
--from=test-tools:local; net -17 lines. bats-extensions COPY dropped
because test-tools:local bundles bats-support / bats-assert under
/usr/lib/bats.

Verified: ./build.sh --no-env test on amd64 — 28/28 smoke tests pass.
v0.9.11's build-worker.yaml had a latent bug (discarded test-tools
image, docker.io pull fail). v0.9.12 ships the load:true fix — this
is the first PR exercising the test-tools:local pattern downstream,
so must pin to v0.9.12. template/ subtree stays at v0.9.11 locally
(CI uses the remote @tag, not the subtree); a full subtree upgrade
to v0.9.12 can follow in a separate PR.
v0.9.12's load:true attempt didn't actually share images between buildx
steps (docker/build-push-action#581). Template v0.9.13 ships D plan:
test-tools is published to ghcr.io/ycpss91255-docker/test-tools:<tag>
per release, and build-worker.yaml passes the GHCR tag via
TEST_TOOLS_IMAGE build-arg instead of building test-tools:local in-job.

Dockerfile changes:
- Top-level ARG TEST_TOOLS_IMAGE="test-tools:local" default keeps local
  ./build.sh flow unchanged (builds Dockerfile.test-tools into host
  Docker daemon).
- New FROM ${TEST_TOOLS_IMAGE} AS test-tools-stage alias.
- 4 COPY --from=test-tools:local switched to --from=test-tools-stage.

main.yaml: @v0.9.12 → @v0.9.13 so build-worker passes the resolved
GHCR tag for this build.

Verified locally: ./build.sh --no-env test on amd64 — 28/28 smoke
tests pass, build succeeds with the default test-tools:local ARG.
@ycpss91255 ycpss91255 merged commit 1d734b8 into main Apr 24, 2026
4 checks passed
@ycpss91255 ycpss91255 deleted the fix/dockerfile-test-tools-migration branch April 24, 2026 07:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant