Fix opencode install: set SHELL env for Alpine compatibility
Some checks failed
CI / lint-and-test (push) Successful in 41s
Deploy Production / deploy (push) Failing after 2m51s
CI / build (push) Failing after 3m21s

The opencode installer script requires $SHELL to be set, which Alpine's
sh in Docker doesn't provide. This caused the install to download the
binary but fail before placing it, silently swallowed by the || fallback.
Also hardcode the known install path and fail the build if it's missing.
This commit is contained in:
Julia McGhee
2026-03-21 22:49:50 +00:00
parent d1639f1bbe
commit 111b189205

View File

@@ -40,12 +40,8 @@ RUN apk add --no-cache git github-cli curl ca-certificates
# Agent CLIs (installed globally before dropping to non-root) # Agent CLIs (installed globally before dropping to non-root)
RUN npm install -g @anthropic-ai/claude-code @openai/codex RUN npm install -g @anthropic-ai/claude-code @openai/codex
RUN curl -fsSL https://opencode.ai/install | sh || \ RUN SHELL=/bin/sh curl -fsSL https://opencode.ai/install | SHELL=/bin/sh sh && \
echo "WARN: opencode install failed, skipping" cp /root/.opencode/bin/opencode /usr/local/bin/opencode
# Ensure opencode is on PATH (installer may place it in ~/.opencode/bin or ~/.local/bin)
RUN for p in /root/.opencode/bin/opencode /root/.local/bin/opencode; do \
if [ -f "$p" ]; then cp "$p" /usr/local/bin/opencode; break; fi; \
done
# MCP servers: Gitea (Go binary from builder stage) # MCP servers: Gitea (Go binary from builder stage)
COPY --from=gitea-mcp-builder /usr/local/bin/gitea-mcp /usr/local/bin/gitea-mcp COPY --from=gitea-mcp-builder /usr/local/bin/gitea-mcp /usr/local/bin/gitea-mcp