hermes-agent/docker
Ben Barclay 5446153c98
fix(docker): chown build trees on UID remap independently of $HERMES_HOME (#35027 regression) (#38556)
The stage2 hook gates the recursive chown of the build trees under
$INSTALL_DIR (.venv, ui-tui, node_modules) so a HERMES_UID/PUID remap
leaves them writable by the new runtime UID — needed for lazy_deps
'uv pip install' of platform extras (#15012, #21100) and the TUI esbuild
rebuild into ui-tui/dist (#28851).

#35027 folded that chown under the $HERMES_HOME ownership check
('stat $HERMES_HOME != hermes_uid'). But 'usermod -u <new> hermes'
re-chowns the hermes home dir ($HERMES_HOME == /opt/data) to the new UID
as a side effect, so after any remap that stat is already satisfied and
needs_chown is false — silently skipping the build-tree chown on the
common PUID/NAS path. The venv stays owned by the build-time UID (10000),
so lazy installs and TUI rebuilds fail with EACCES.

Probe the build trees directly instead: chown only when /opt/hermes/.venv
is not already owned by the runtime hermes UID. Independent of
$HERMES_HOME ownership, idempotent across restarts.

Verified live: built the image, booted with HERMES_UID/HERMES_GID on a
fresh named volume, confirmed .venv/ui-tui/node_modules end up owned by
the remapped UID and 'uv pip install' into the venv succeeds; confirmed
the recursive chown fires once and is skipped on restart.
2026-06-04 10:17:55 +10:00
..
cont-init.d Remove prviliges drop when you never ran as root (#34837) 2026-06-01 13:54:18 +10:00
s6-rc.d Remove prviliges drop when you never ran as root (#34837) 2026-06-01 13:54:18 +10:00
entrypoint.sh docs(docker): deprecation warning in entrypoint.sh shim 2026-05-24 18:05:33 -07:00
hermes-exec-shim.sh fix(docker): drop docker exec to hermes uid before invoking the CLI 2026-05-28 13:30:36 +10:00
main-wrapper.sh fix(docker): preserve Docker -w workdir in main-wrapper (#35472) (#36259) 2026-06-02 16:13:44 +10:00
SOUL.md feat(docker): add Docker container for the agent (salvage #1841) (#3668) 2026-03-28 22:21:48 -07:00
stage2-hook.sh fix(docker): chown build trees on UID remap independently of $HERMES_HOME (#35027 regression) (#38556) 2026-06-04 10:17:55 +10:00