Skip to content

fix: rewrite Dockerfile for CI build context, not monorepo#3

Merged
davidfic merged 1 commit intomainfrom
fix/dockerfile-ci-context
Apr 16, 2026
Merged

fix: rewrite Dockerfile for CI build context, not monorepo#3
davidfic merged 1 commit intomainfrom
fix/dockerfile-ci-context

Conversation

@davidfic
Copy link
Copy Markdown
Contributor

Unblocks haul's main-branch Docker job, which was failing on:

```
failed to calculate checksum of ref ...: "/web-shared": not found
failed to calculate checksum of ref ...: "/haul/web/ui/package.json": not found
```

What was wrong

The old Dockerfile assumed the build context was the beacon monorepo root, with `haul/`, `web-shared/`, and `pulse/` as sibling directories. It worked for local `docker build -f haul/docker/Dockerfile .` runs from the monorepo root, but CI's build context is the haul repo root and none of those paths exist there.

What this does

  • Frontend stage copies `web/ui/` directly (was `haul/web/ui/`)
  • Drops the separate `COPY web-shared/` — shared components are now vendored at `web/ui/src/shared/` via git subtree and ride along with the rest of `web/ui/`
  • Drops the pulse sibling copy and the `sed` rewrite of the go.mod replace directive. That replace was removed entirely when we pinned `pulse v0.1.0` via a normal `require`, so Go build stage is just `go mod download` + `go build` with no cross-module surgery.
  • Binary lands at `/haul` and gets copied to `/usr/local/bin/haul` in the final stage (pilot/prism convention)
  • Still `CGO_ENABLED=0` on `alpine:3.21`

Test plan

  • PR CI green (test/lint/build — docker job is gated to main, won't run on PR)
  • Main CI green after merge
  • `ghcr.io/beacon-stack/haul:latest` publishes

The previous Dockerfile assumed the docker build context was the
beacon monorepo root directory (/data/home/davidfic/dev/beacon/),
with haul/, web-shared/, and pulse/ as sibling directories. That
works for local `docker build -f haul/docker/Dockerfile .` runs
from the monorepo root but falls over immediately in CI because
the GitHub workflow's docker build context is the haul repo root,
and none of haul/web/ui/package.json, web-shared/, or pulse/ exist
at those paths — they live at web/ui/package.json, web/ui/src/shared/
(vendored via git subtree now), and a go.mod require github.com/beacon-stack/pulse
respectively.

CI was failing with:

    failed to calculate checksum of ref ...: "/web-shared": not found
    failed to calculate checksum of ref ...: "/haul/web/ui/package.json": not found

Rewrites the Dockerfile to match the CI build context (haul repo
root) and to stop relying on the sibling-dir layout:

- Frontend stage copies web/ui/ directly (instead of haul/web/ui/)
- Drops the separate COPY web-shared/ step — the shared components
  are vendored into web/ui/src/shared/ via git subtree, so they
  come along with the rest of web/ui/.
- Drops the pulse sibling copy and the `sed` rewrite of the go.mod
  replace directive. That replace directive was removed entirely
  when we pinned pulse v0.1.0 via a normal require, so the Go build
  stage just runs `go mod download` and `go build` with no
  cross-module surgery.
- Output binary lands at /haul and gets copied into the final stage
  at /usr/local/bin/haul, matching the pilot/prism conventions.
- Still uses CGO_ENABLED=0 and alpine:3.21 as before.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@davidfic davidfic merged commit 9d7113e into main Apr 16, 2026
6 checks passed
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