Skip to content

feat: initial Containerfile, devfiles, scripts, and CI#2

Merged
jflowers merged 6 commits intomainfrom
001-initial-containerfile
Apr 12, 2026
Merged

feat: initial Containerfile, devfiles, scripts, and CI#2
jflowers merged 6 commits intomainfrom
001-initial-containerfile

Conversation

@jflowers
Copy link
Copy Markdown
Contributor

Summary

Implements all 8 deliverables from Issue #1 (Discussion #88):

  • Containerfile — Fedora 41 base, Go 1.25, full UF toolchain (uf, dewey, replicator, gaze, OpenCode, golangci-lint, govulncheck, OpenSpec CLI), non-root dev user
  • Containerfile.udi — UDI base variant for Eclipse Che / Dev Spaces
  • devfile.yaml — Devfile 2.2.0 workspace with custom image
  • devfile-dynamic.yaml — Devfile 2.2.0 with UDI + postStart (no custom image)
  • scripts/ — install-uf-tools.sh, entrypoint.sh, extract-changes.sh, connect.sh
  • podman-compose.yml — Headless server mode (Model B) with read-only source mount
  • CI workflow — Multi-arch build (arm64 + amd64) and push to quay.io
  • README.md — All 3 deployment models, security model, smoke tests

Verification

Image builds successfully and all smoke tests pass:

podman build -t opencode-dev -f Containerfile .
podman run --rm opencode-dev uf --version      # ✓
podman run --rm opencode-dev dewey version      # ✓
podman run --rm opencode-dev replicator --version # ✓
podman run --rm opencode-dev gaze --version     # ✓
podman run --rm opencode-dev whoami             # dev ✓

Review

  • Spec review: APPROVED (5 Divisor agents, 6 auto-fixes)
  • Code review: APPROVED (5 Divisor agents, 2 fixes)
  • 3 retrospective learnings stored in Dewey

Closes #1

Implement all 8 deliverables from Issue #1:
- Containerfile (Fedora 41, Go 1.25, full UF toolchain, non-root dev user)
- Containerfile.udi (UDI base for Eclipse Che / Dev Spaces)
- devfile.yaml and devfile-dynamic.yaml (Devfile 2.2.0)
- scripts: install-uf-tools, entrypoint, extract-changes, connect
- podman-compose.yml for headless server mode (Model B)
- CI workflow for multi-arch build and push to quay.io
- README documenting all 3 deployment models
- Full spec artifacts (spec, plan, research, contracts, tasks)
ECONNRESET during zod download caused CI build failure.
Retry npm install up to 3 times with 5s delay between attempts.
Three issues addressed:
- Fix dewey --version → dewey version in smoke tests
- Build native amd64 first, run smoke tests, then add arm64
  (was building 3 times: amd64 manifest, arm64 manifest, test)
- Reuse native image in manifest via containers-storage
  instead of rebuilding
The OpenCode curl installer places the binary at
~/.opencode/bin/opencode and updates .bashrc, but .bashrc
is not sourced by the container entrypoint. Adding the
directory to the ENV PATH makes it available to all
execution contexts.
The entrypoint logs (workspace detection, Ollama check) pollute
stdout, causing the USER_OUTPUT comparison to fail. Using
--entrypoint whoami gets clean output for the user check.
Eliminate QEMU emulation for cross-arch builds (~40 min → ~10 min target):
- Add Containerfile.base (Fedora 41 + Go 1.25 + system packages)
- Add build-base.yml CI workflow (weekly schedule + manual dispatch)
- Refactor Containerfile to use opencode-base as FROM (109 → 48 lines)
- Refactor build-push.yml to use native runners (ubuntu-24.04-arm)
- Update spec with FR-022–FR-027, SC-001 (10 min CI target)
@jflowers jflowers merged commit 66630fb into main Apr 12, 2026
1 of 3 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.

feat: initial Containerfile, devfile, and scripts for containerized OpenCode

1 participant