Docker container fails to start due to bun dependency install issue #3129

Closed
opened 2026-02-16 17:38:46 -05:00 by yindo · 10 comments
Owner

Originally created by @Nindaleth on GitHub (Nov 26, 2025).

Originally assigned to: @thdxr on GitHub.

Description

Using the docker run -it --rm ghcr.io/sst/opencode command from Install - Using Docker, the following happens:

# docker run -it --rm ghcr.io/sst/opencode
Unable to find image 'ghcr.io/sst/opencode:latest' locally
latest: Pulling from sst/opencode
Digest: sha256:1ace13d6e85d98a3edcebf6eb973f7f5b619fd8cfcd5b8a38896c8f67c4d310a
Status: Downloaded newer image for ghcr.io/sst/opencode:latest
^[[O^[[O^[[O^[[O{"name":"BunInstallFailedError","data":{"pkg":"opencode-copilot-auth","version":"0.0.7"}}

This is the log on the 2nd try (the control characters are generated by the container):

# docker run -it --rm ghcr.io/sst/opencode
{"name":"BunInstallFailedError","data":{"pkg":"opencode-copilot-auth","version":"0.0.7"}}
^[[O^[[O^[[O^[[O

The container hangs on a black screen for a minute. My public internet should be normally available (as evident from docker pulling the image).

I verified by image hash that the tag latest matches tag 1.0.114.

OpenCode version

1.0.114

Steps to reproduce

docker run -it --rm ghcr.io/sst/opencode

Screenshot and/or share link

No response

Operating System

Fedora 43 x86_64

Terminal

terminator 2.1.5

Originally created by @Nindaleth on GitHub (Nov 26, 2025). Originally assigned to: @thdxr on GitHub. ### Description Using the `docker run -it --rm ghcr.io/sst/opencode` command from [Install - Using Docker](https://opencode.ai/docs/#install), the following happens: ``` # docker run -it --rm ghcr.io/sst/opencode Unable to find image 'ghcr.io/sst/opencode:latest' locally latest: Pulling from sst/opencode Digest: sha256:1ace13d6e85d98a3edcebf6eb973f7f5b619fd8cfcd5b8a38896c8f67c4d310a Status: Downloaded newer image for ghcr.io/sst/opencode:latest ^[[O^[[O^[[O^[[O{"name":"BunInstallFailedError","data":{"pkg":"opencode-copilot-auth","version":"0.0.7"}} ``` This is the log on the 2nd try (the control characters are generated by the container): ``` # docker run -it --rm ghcr.io/sst/opencode {"name":"BunInstallFailedError","data":{"pkg":"opencode-copilot-auth","version":"0.0.7"}} ^[[O^[[O^[[O^[[O ``` The container hangs on a black screen for a minute. My public internet should be normally available (as evident from docker pulling the image). I verified by image hash that the tag `latest` matches tag `1.0.114`. ### OpenCode version 1.0.114 ### Steps to reproduce docker run -it --rm ghcr.io/sst/opencode ### Screenshot and/or share link _No response_ ### Operating System Fedora 43 x86_64 ### Terminal terminator 2.1.5
yindo added the bug label 2026-02-16 17:38:46 -05:00
yindo closed this issue 2026-02-16 17:38:46 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Nov 26, 2025):

This issue might be a duplicate of existing issues. Please check:

  • #3138: BunInstallFailedError with installation failures (similar error pattern)
  • #2341: opencode-copilot-auth error (same package causing issues)
  • #3350: Cannot find module opencode-copilot-auth (same dependency failure)
  • #1920: Failed to build opencode in docker (previous Docker build issues)
  • #4137: Race condition with installDependencies() (dependency installation race)

Feel free to ignore if none of these address your specific case.

@github-actions[bot] commented on GitHub (Nov 26, 2025): This issue might be a duplicate of existing issues. Please check: - #3138: BunInstallFailedError with installation failures (similar error pattern) - #2341: opencode-copilot-auth error (same package causing issues) - #3350: Cannot find module opencode-copilot-auth (same dependency failure) - #1920: Failed to build opencode in docker (previous Docker build issues) - #4137: Race condition with installDependencies() (dependency installation race) Feel free to ignore if none of these address your specific case.
Author
Owner

@rekram1-node commented on GitHub (Nov 26, 2025):

Does that happen everytime for u? Or is it intermittent

@rekram1-node commented on GitHub (Nov 26, 2025): Does that happen everytime for u? Or is it intermittent
Author
Owner

@Nindaleth commented on GitHub (Nov 26, 2025):

It's very peculiar. On my desktop it works 100% of the time, on my laptop (ThinkPad P14s Gen2, AMD variant) it works 0% of the time, always the same error. Same Fedora 43 on Wayland, same Terminator terminal, sitting on the same desk connected to the same wired LAN.

What does work on both is docker run -it --rm ghcr.io/sst/opencode --help - the help screen is shown alright, it's just when the TUi is about to start that it gets problematic.

@Nindaleth commented on GitHub (Nov 26, 2025): It's very peculiar. On my desktop it works 100% of the time, on my laptop (ThinkPad P14s Gen2, AMD variant) it works 0% of the time, always the same error. Same Fedora 43 on Wayland, same Terminator terminal, sitting on the same desk connected to the same wired LAN. What does work on both is `docker run -it --rm ghcr.io/sst/opencode --help` - the help screen is shown alright, it's just when the TUi is about to start that it gets problematic.
Author
Owner

@Nindaleth commented on GitHub (Nov 26, 2025):

Here's a log I was able to extract from the docker container:
2025-11-26T220647.log

@Nindaleth commented on GitHub (Nov 26, 2025): Here's a log I was able to extract from the docker container: [2025-11-26T220647.log](https://github.com/user-attachments/files/23780605/2025-11-26T220647.log)
Author
Owner

@rekram1-node commented on GitHub (Nov 26, 2025):

Ig as a workaround you can pass: OPENCODE_DISABLE_DEFAULT_PLUGINS=true downside is you won't be able to use github copilot oauth or anthropic oauth but everything else should still work

@rekram1-node commented on GitHub (Nov 26, 2025): Ig as a workaround you can pass: `OPENCODE_DISABLE_DEFAULT_PLUGINS=true` downside is you won't be able to use github copilot oauth or anthropic oauth but everything else should still work
Author
Owner

@Nindaleth commented on GitHub (Nov 27, 2025):

Thanks! This still hangs for about 15 seconds on start, but then runs, that sounds good for now.

@Nindaleth commented on GitHub (Nov 27, 2025): Thanks! This still hangs for about 15 seconds on start, but then runs, that sounds good for now.
Author
Owner

@Nindaleth commented on GitHub (Dec 1, 2025):

I identified 2 separate causes of issues on my work laptop:

  • I use a nonstandard UID and GID for work -> when actually mounting something into the container, I had permission issues left and right... desktop is the usual 1000:1000 so not nearly as many issues there
  • for company needs I have an internal DNS server preset in my docker daemon config, that was resolved by providing nameserver by hand

I've worked around these issues and now I can code in docker alright.

BTW, OpenCode seems to expect ripgrep, but it's not available in the official container image.

@Nindaleth commented on GitHub (Dec 1, 2025): I identified 2 separate causes of issues on my work laptop: * I use a nonstandard UID and GID for work -> when actually mounting something into the container, I had permission issues left and right... desktop is the usual 1000:1000 so not nearly as many issues there * for company needs I have an internal DNS server preset in my docker daemon config, that was resolved by providing nameserver by hand I've worked around these issues and now I can code in docker alright. BTW, OpenCode [seems](https://opencode.ai/docs/tools/#internals) to [expect](https://github.com/sst/opencode/blob/main/packages/opencode/src/tool/bash.txt#L25) ripgrep, but it's not available in the official container image.
Author
Owner

@rekram1-node commented on GitHub (Dec 1, 2025):

We automatically install it if it isn't available but I guess that isn't working for you?

@rekram1-node commented on GitHub (Dec 1, 2025): We automatically install it if it isn't available but I guess that isn't working for you?
Author
Owner

@Nindaleth commented on GitHub (Dec 1, 2025):

No, not even on the desktop where I have no issues, using the default Big Pickle model with the official image.

The documentation recommends docker run -it --rm ghcr.io/sst/opencode, so even if rg got installed, it will be lost immediately after quitting the container.

Sorry for going off-topic; I have solved my local root causes and from my perspective this issue can be closed.

@Nindaleth commented on GitHub (Dec 1, 2025): No, not even on the desktop where I have no issues, using the default Big Pickle model with the official image. The [documentation](https://opencode.ai/docs/#install) recommends `docker run -it --rm ghcr.io/sst/opencode`, so even if `rg` got installed, it will be lost immediately after quitting the container. Sorry for going off-topic; I have solved my local root causes and from my perspective this issue can be closed.
Author
Owner

@rekram1-node commented on GitHub (Dec 1, 2025):

ah I see, yeah we will prolly want to bundle it in automatically

@rekram1-node commented on GitHub (Dec 1, 2025): ah I see, yeah we will prolly want to bundle it in automatically
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#3129