Skip to content

fix: reduce image size by dropping OpenCode V1 and unused platform binaries - #37

Merged
nikbucher merged 2 commits into
mainfrom
fix/36-reduce-image-size
Oct 18, 2026
Merged

nikbucher merged 2 commits into
mainfrom
fix/36-reduce-image-size

Conversation

@nikbucher

Copy link
Copy Markdown
Owner

Fixes #36.

Changes

  • Base image opencode-docker → shell-docker: the V1 layer (~520 MB compressed) is no longer shipped. An npm uninstall on top would only have added whiteouts.
  • Drop @opencode/cli/node_modules after install. Its only contents are the platform binaries (optionalDependencies without a libc field, so npm installs both the glibc and musl variant). The postinstall hard-links or copies the matching binary into bin/, so the binary survives the delete.
  • Remove --omit=optional, which had no effect.
  • Restore what opencode-docker provided and shell-docker lacks: CMD ["opencode"] and an agent-owned ~/.config/opencode. Env, user and tini entrypoint are identical.
  • CI: smoke-test arm64 (under QEMU) in addition to amd64, and fail if nested platform packages come back or @opencode exceeds 300 MB.
  • Docs: an in-sandbox opencode upgrade reinstalls the unused libc variant, adding ~200 MB to that sandbox only.

Verification (local, arm64)

  • Image 2.66 GB vs 2.97 GB without the delete. Base comparison: opencode-docker 3.22 GB vs shell-docker 2.35 GB (uncompressed, arm64).
  • opencode --version → v2.0.32, package writable by agent, npm ls -g clean.
  • Self-update via npm install -g @opencode/cli@2.0.32 works.
  • The size guard passes on the image and fails after a reinstall.
  • amd64 not verified locally (no emulation on this host), so CI covers it.

🤖 Generated with Claude Code

@nikbucher
nikbucher merged commit d32b357 into main Oct 18, 2026
1 check passed
@nikbucher
nikbucher deleted the fix/36-reduce-image-size branch October 18, 2026 01:02
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.

Image is ~1.5 GB: OpenCode V1 layer and unused platform binaries ship in the image

1 participant