Skip to content

Commit 673f137

Browse files
claudef3l1x
authored andcommitted
opencode: pin the version, verify at build time
A pinned version avoids the rate-limited api.github.com lookup that broke the nodejs test. The binary stays owned by coder, so the coder user can run 'opencode upgrade'. A failed install now fails the build. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01S9abShYK5RMmbeuZurGH3b
1 parent 89d1cd8 commit 673f137

5 files changed

Lines changed: 24 additions & 14 deletions

File tree

‎fx/Dockerfile‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ ENV BUN_INSTALL=/usr/local
55
ENV NODE_VERSION=24
66
ENV GO_VERSION=1.26.5
77
ENV GLAB_VERSION=1.111.0
8+
ENV OPENCODE_VERSION=1.18.13
89
ENV GOROOT=/usr/local/go
910
ENV GOPATH=/home/coder/go
1011
ENV PATH=$GOROOT/bin:$GOPATH/bin:$PATH
@@ -86,9 +87,10 @@ RUN \
8687
if [ -f /root/bin/claude ]; then cp /root/bin/claude /usr/local/bin/claude; fi && \
8788
chmod 0755 /usr/local/bin/claude && \
8889
# OPENCODE ##################################################################
89-
(curl -fsSL https://opencode.ai/install | bash || true) && \
90-
if [ -f /root/.opencode/bin/opencode ]; then cp /root/.opencode/bin/opencode /usr/local/bin/opencode; fi && \
90+
curl -fsSL https://opencode.ai/install | VERSION=${OPENCODE_VERSION} bash -s -- --no-modify-path && \
91+
cp /root/.opencode/bin/opencode /usr/local/bin/opencode && \
9192
chmod 0755 /usr/local/bin/opencode && \
93+
opencode --version && \
9294
# NPM: CODEX, COPILOT #######################################################
9395
npm install -g @openai/codex @github/copilot && \
9496
# PI ########################################################################

‎golang/Dockerfile‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ FROM codercom/enterprise-base:ubuntu
33
ENV NODE_VERSION=24
44
ENV GO_VERSION=1.26.5
55
ENV GLAB_VERSION=1.111.0
6+
ENV OPENCODE_VERSION=1.18.13
67
ENV GOROOT=/usr/local/go
78
ENV GOPATH=/home/coder/go
89
ENV PATH=$GOROOT/bin:$GOPATH/bin:$PATH
@@ -50,11 +51,12 @@ RUN \
5051
chmod +x /home/coder/.local/bin/claude 2>/dev/null || true && \
5152
ln -sf /home/coder/.local/bin/claude /usr/local/bin/claude && \
5253
# OPENCODE ##################################################################
53-
(curl -fsSL https://opencode.ai/install | bash || true) && \
54+
curl -fsSL https://opencode.ai/install | VERSION=${OPENCODE_VERSION} bash -s -- --no-modify-path && \
5455
mkdir -p /home/coder/.opencode/bin && \
55-
if [ -f /root/.opencode/bin/opencode ]; then cp /root/.opencode/bin/opencode /home/coder/.opencode/bin/opencode; fi && \
56-
chmod +x /home/coder/.opencode/bin/opencode 2>/dev/null || true && \
56+
cp /root/.opencode/bin/opencode /home/coder/.opencode/bin/opencode && \
57+
chmod 0755 /home/coder/.opencode/bin/opencode && \
5758
ln -sf /home/coder/.opencode/bin/opencode /usr/local/bin/opencode && \
59+
opencode --version && \
5860
# NPM: CODEX, COPILOT #######################################################
5961
npm install -g @openai/codex @github/copilot && \
6062
# PI ########################################################################

‎nodejs/Dockerfile‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ ENV DENO_INSTALL=/usr/local
44
ENV BUN_INSTALL=/usr/local
55
ENV NODE_VERSION=24
66
ENV GLAB_VERSION=1.111.0
7+
ENV OPENCODE_VERSION=1.18.13
78

89
USER root
910

@@ -46,11 +47,12 @@ RUN \
4647
chmod +x /home/coder/.local/bin/claude 2>/dev/null || true && \
4748
ln -sf /home/coder/.local/bin/claude /usr/local/bin/claude && \
4849
# OPENCODE ##################################################################
49-
(curl -fsSL https://opencode.ai/install | bash || true) && \
50+
curl -fsSL https://opencode.ai/install | VERSION=${OPENCODE_VERSION} bash -s -- --no-modify-path && \
5051
mkdir -p /home/coder/.opencode/bin && \
51-
if [ -f /root/.opencode/bin/opencode ]; then cp /root/.opencode/bin/opencode /home/coder/.opencode/bin/opencode; fi && \
52-
chmod +x /home/coder/.opencode/bin/opencode 2>/dev/null || true && \
52+
cp /root/.opencode/bin/opencode /home/coder/.opencode/bin/opencode && \
53+
chmod 0755 /home/coder/.opencode/bin/opencode && \
5354
ln -sf /home/coder/.opencode/bin/opencode /usr/local/bin/opencode && \
55+
opencode --version && \
5456
# NPM: CODEX, COPILOT #######################################################
5557
npm install -g @openai/codex @github/copilot && \
5658
# PI ########################################################################

‎php/Dockerfile‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ FROM codercom/enterprise-base:ubuntu
22

33
ENV NODE_VERSION=24
44
ENV GLAB_VERSION=1.111.0
5+
ENV OPENCODE_VERSION=1.18.13
56

67
USER root
78

@@ -53,11 +54,12 @@ RUN \
5354
chmod +x /home/coder/.local/bin/claude 2>/dev/null || true && \
5455
ln -sf /home/coder/.local/bin/claude /usr/local/bin/claude && \
5556
# OPENCODE ##################################################################
56-
(curl -fsSL https://opencode.ai/install | bash || true) && \
57+
curl -fsSL https://opencode.ai/install | VERSION=${OPENCODE_VERSION} bash -s -- --no-modify-path && \
5758
mkdir -p /home/coder/.opencode/bin && \
58-
if [ -f /root/.opencode/bin/opencode ]; then cp /root/.opencode/bin/opencode /home/coder/.opencode/bin/opencode; fi && \
59-
chmod +x /home/coder/.opencode/bin/opencode 2>/dev/null || true && \
59+
cp /root/.opencode/bin/opencode /home/coder/.opencode/bin/opencode && \
60+
chmod 0755 /home/coder/.opencode/bin/opencode && \
6061
ln -sf /home/coder/.opencode/bin/opencode /usr/local/bin/opencode && \
62+
opencode --version && \
6163
# NPM: CODEX, COPILOT #######################################################
6264
npm install -g @openai/codex @github/copilot && \
6365
# PI ########################################################################

‎python/Dockerfile‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ FROM codercom/enterprise-base:ubuntu
22

33
ENV NODE_VERSION=24
44
ENV GLAB_VERSION=1.111.0
5+
ENV OPENCODE_VERSION=1.18.13
56

67
USER root
78

@@ -42,11 +43,12 @@ RUN \
4243
chmod +x /home/coder/.local/bin/claude 2>/dev/null || true && \
4344
ln -sf /home/coder/.local/bin/claude /usr/local/bin/claude && \
4445
# OPENCODE ##################################################################
45-
(curl -fsSL https://opencode.ai/install | bash || true) && \
46+
curl -fsSL https://opencode.ai/install | VERSION=${OPENCODE_VERSION} bash -s -- --no-modify-path && \
4647
mkdir -p /home/coder/.opencode/bin && \
47-
if [ -f /root/.opencode/bin/opencode ]; then cp /root/.opencode/bin/opencode /home/coder/.opencode/bin/opencode; fi && \
48-
chmod +x /home/coder/.opencode/bin/opencode 2>/dev/null || true && \
48+
cp /root/.opencode/bin/opencode /home/coder/.opencode/bin/opencode && \
49+
chmod 0755 /home/coder/.opencode/bin/opencode && \
4950
ln -sf /home/coder/.opencode/bin/opencode /usr/local/bin/opencode && \
51+
opencode --version && \
5052
# NPM: CODEX, COPILOT #######################################################
5153
npm install -g @openai/codex @github/copilot && \
5254
# PI ########################################################################

0 commit comments

Comments
 (0)