fix: use Dockerfile USER directive + writable .bun dir

The --user runner container option doesn't set up the user environment
properly — bun can't write temp files even with TMPDIR overrides.
Switch to USER runner in the Dockerfile which properly sets HOME and
creates the user context. Also pre-create ~/.bun owned by runner.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Garry Tan
2026-03-23 17:35:49 -07:00
parent cdd6373147
commit 964332a160
2 changed files with 10 additions and 5 deletions
+5 -1
View File
@@ -58,4 +58,8 @@ RUN mv /workspace/node_modules /opt/node_modules_cache \
RUN useradd -m -s /bin/bash runner \
&& chmod -R a+rX /opt/node_modules_cache \
&& mkdir -p /home/runner/.gstack && chown -R runner:runner /home/runner/.gstack \
&& chmod 1777 /tmp
&& chmod 1777 /tmp \
&& mkdir -p /home/runner/.bun && chown -R runner:runner /home/runner/.bun
# Switch to runner user — bun needs HOME-writable for temp files
USER runner