Skip to content

fix(opencode): preload libucontext in Docker image#29223

Open
itamarhaber wants to merge 3 commits into
anomalyco:devfrom
itamarhaber:fix/docker-libucontext
Open

fix(opencode): preload libucontext in Docker image#29223
itamarhaber wants to merge 3 commits into
anomalyco:devfrom
itamarhaber:fix/docker-libucontext

Conversation

@itamarhaber
Copy link
Copy Markdown

@itamarhaber itamarhaber commented May 25, 2026

Issue for this PR

Closes #28314
Closes #28756
Related to #27589

Type of change

  • Bug fix
  • New feature
  • Refactor / code improvement
  • Documentation

What does this PR do?

The Docker image is based on Alpine/musl, and the OpenTUI renderer needs getcontext when loading its native render library. Alpine does not provide that symbol from libc, so the TUI can fail after startup/migration with getcontext: symbol not found.

This adds Alpine libucontext to the Docker runtime image and preloads it so the renderer can resolve getcontext before OpenTUI starts.

How did you verify your code works?

  • docker build --target base -f packages/opencode/Dockerfile -t opencode-docker-base-test .
  • docker run --rm --entrypoint sh opencode-docker-base-test -lc "test -f /usr/lib/libucontext.so.1 && test \"$LD_PRELOAD\" = /usr/lib/libucontext.so.1"
  • validated the same libucontext/LD_PRELOAD change against ghcr.io/anomalyco/opencode:1.15.5 with --print-logs; the TUI renderer initialized and started drawing

Screenshots / recordings

N/A

Checklist

  • I have tested my changes locally
  • I have not included unrelated changes in this PR

@github-actions github-actions Bot added the needs:compliance This means the issue will auto-close after 2 hours. label May 25, 2026
@github-actions github-actions Bot removed the needs:compliance This means the issue will auto-close after 2 hours. label May 25, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Thanks for updating your PR! It now meets our contributing guidelines. 👍

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.

Failed to initialize OpenTUI render library Opencode in docker container wont start opencode TUI

1 participant