Migrate build system from Earthly to pure Docker#1
Draft
JWhitleyWork wants to merge 3 commits into
Draft
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The Space ROS image build depended on Earthly, which is an extra, non-standard tool to install and maintain (CI downloaded a release binary on every run) and has known issues moving large image layers from its internal registry proxy into the local Docker daemon (the
--disable-remote-registry-proxyworkaround in the old usage docs). This migrates the build to plain Docker so the only required tooling is Docker with Buildx (already present in current installs).Approach
A single multi-stage
Dockerfilereproduces every Earthly stage. Mapping:COPY +stage/artifact→COPY --from=stage(WORKDIR is/spaceros_ws).--build-arg IMAGE_VARIANT={main,dev}+ a shellifin thebuildandimagestages. An unrecognized variant is now a hard error instead of silently building the release path.COPY --fromcannot expand build args, so aFROM ikos-${IMAGE_VARIANT}selector stage resolves to the populated IKOS install fordevand an empty directory formain. IKOS is added toPATHat runtime byentrypoint.sh(gated on/opt/ikos/binexisting) so the bare-bones main image keeps a clean environment.SAVE ARTIFACT … AS LOCAL→ twoFROM scratchexport stages (export-repos,export-build-test) consumed viadocker buildx … --output type=local.A
Makefilewraps thedocker buildxinvocations (main-image,dev-image,all,build-test,generate-repos) as drop-in replacements for the oldearthly +targetcommands.CI (
earthly-build.yaml→docker-build.yaml) switches todocker buildxwithdocker/setup-buildx-action, using--loadso the existingdocker tag/docker pushsteps still find the image in the local daemon. All GHCR/DockerHub push conditionals, image labels, the build-test archive upload, and triggers are preserved unchanged.WORKSPACE_DIRis pinned to a fixedENV(not an overridable build-arg) so the absolute paths the export stages copy from stay consistent.Commits
Dockerfile,Makefile,.dockerignore,entrypoint.sh).Earthfileand update docs.Notes / follow-ups
cache-from/cache-to: type=ghawould restore parity but the dev build's cache likely exceeds GHA's 10 GB limit, so it was left out pending a real CI run to tune.raw.githubusercontent.com);docker buildx build --checkpasses for all targets and the pre-installation/setup stages execute up to that network call. A real CI run is the end-to-end validation.