Skip to content

Commit f69e255

Browse files
committed
Symlink claude/opencode to /usr/local/bin instead of copying
Install binaries to coder user's local paths and symlink from /usr/local/bin, so that `claude upgrade` and `opencode` self-updates are automatically reflected without the /usr/local/bin copy going stale. https://claude.ai/code/session_017RKNgQUVfCEWK8oGpd7gsx
1 parent 67f5167 commit f69e255

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

fx/Dockerfile

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,17 @@ RUN apt update && apt dist-upgrade -y && \
3535
curl -fsSL https://bun.sh/install | bash && \
3636
# CLAUDE ####################################################################
3737
(curl -fsSL https://claude.ai/install.sh | bash || true) && \
38-
if [ -f /root/.local/bin/claude ]; then cp /root/.local/bin/claude /usr/local/bin/claude && chmod +x /usr/local/bin/claude; fi && \
39-
if [ -f /root/bin/claude ]; then cp /root/bin/claude /usr/local/bin/claude && chmod +x /usr/local/bin/claude; fi && \
38+
mkdir -p /home/coder/.local/bin && \
39+
if [ -f /root/.local/bin/claude ]; then cp /root/.local/bin/claude /home/coder/.local/bin/claude; fi && \
40+
if [ -f /root/bin/claude ]; then cp /root/bin/claude /home/coder/.local/bin/claude; fi && \
41+
chmod +x /home/coder/.local/bin/claude 2>/dev/null || true && \
42+
ln -sf /home/coder/.local/bin/claude /usr/local/bin/claude && \
4043
# OPENCODE ##################################################################
4144
(curl -fsSL https://opencode.ai/install | bash || true) && \
42-
if [ -f /root/.opencode/bin/opencode ]; then cp /root/.opencode/bin/opencode /usr/local/bin/opencode && chmod +x /usr/local/bin/opencode; fi && \
45+
mkdir -p /home/coder/.opencode/bin && \
46+
if [ -f /root/.opencode/bin/opencode ]; then cp /root/.opencode/bin/opencode /home/coder/.opencode/bin/opencode; fi && \
47+
chmod +x /home/coder/.opencode/bin/opencode 2>/dev/null || true && \
48+
ln -sf /home/coder/.opencode/bin/opencode /usr/local/bin/opencode && \
4349
# NPM: CODEX, COPILOT #######################################################
4450
npm install -g @openai/codex @github/copilot && \
4551
# CHROME LIBS (AGENT-BROWSER) ###############################################
@@ -58,6 +64,8 @@ RUN apt update && apt dist-upgrade -y && \
5864
echo 'export BUN_INSTALL="${BUN_INSTALL:-/usr/local}"' >> /etc/profile && \
5965
echo '[ -d "$DENO_INSTALL/bin" ] && export PATH="$DENO_INSTALL/bin:$PATH"' >> /etc/profile && \
6066
echo '[ -d "$BUN_INSTALL/bin" ] && export PATH="$BUN_INSTALL/bin:$PATH"' >> /etc/profile && \
67+
# OWNERSHIP (coder can upgrade tools) ######################################
68+
chown -R coder:coder /home/coder/.local /home/coder/.opencode 2>/dev/null || true && \
6169
# CLEANUP ###################################################################
6270
apt clean -y && \
6371
apt autoclean -y && \

0 commit comments

Comments
 (0)