You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
running opencode fails in alpine / musl based distros #649
Might be a alpine specific issue. I used the official oven/bun:alpine docker image, ran bun install -g opencode-ai. Tried running opencode and got an error sh: ./opencode: not found 🤷
I haven't tested it out thoroughly, but I was able to create a container with it and install a working opencode binary using just curl -fsSL https://opencode.ai/install | bash
Activity
JayJamieson commentedon Jul 4, 2025
Might be a alpine specific issue. I used the official
oven/bun:alpinedocker image, ranbun install -g opencode-ai. Tried running opencode and got an errorsh: ./opencode: not found🤷markuest commentedon Jul 4, 2025
i can confirm. this keeps me from using opencode in alpine-based devcontainers
[-]running opencode fails in alpine wsl[/-][+]running opencode fails in alpine / musl based distros[/+]r1bilski commentedon Oct 14, 2025
FYI if you clone the repo you can run
bun devto run it just fine. You can also build your own binary and install it manually.banksean commentedon Oct 18, 2025
The binary appears to be dynamically linked with glibc (/lib/ld-linux-aarch64.so.1):
file /usr/local/bin/opencode /usr/local/bin/opencode: ELF 64-bit LSB executable, ARM aarch64, version 1 (SYSV), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1, for GNU/Linux 3.7.0, BuildID[sha1]=76b7a6753f7bcf3ef62be90711f555de5656a276, not strippedStock alpine doesn't seem to know what to do with glibc-linked binaries since it uses musl instead.
One potential workaround (that seems to work in my case, at least) is to use this alpine-based image that includes glibc support: https://hub.docker.com/r/frolvlad/alpine-glibc/
I haven't tested it out thoroughly, but I was able to create a container with it and install a working opencode binary using just
curl -fsSL https://opencode.ai/install | bashmarkuest commentedon Nov 3, 2025
this has been fixed since v1.0edit: this has not been fixed
markuest commentedon Nov 4, 2025
in my previous comment i tested with my own build instead of the official release. the issue still exists in v1.0.20
kalvenschraut commentedon Nov 15, 2025
https://github.com/sst/opencode/releases/tag/v1.0.56 includes a musl build now and it works on alpine for me
markuest commentedon Nov 17, 2025
thank you. tested it with 1.0.68 and i can confirm it works now.
remorses commentedon Jan 6, 2026
Why would you want to use alpine? Do you want to make Docker images smaller?
markuest commentedon Jan 7, 2026
i mainly use alpine in my dev wsl for the following reasons:
i do not ship many docker images, so small docker image size was not relevant to me.
that just seems to be a byproduct of the design decisions above
feat: add block-no-verify hook for Claude Code and Cursor (anomalyco#649
fix(sidebar): keep sessions visible across workers (anomalyco#649)
edwardcapriolo commentedon May 13, 2026
If you use alpine you can get pretty far with this:
#RUN apk add gcompat libstdc++ libgcc
However I find that it blows up trying to do more advanced stuff like MCP where linked binaries come into later issues MCP