Problem
The official Docker image has entrypoint.sh which drops from root → uid 10000 (hermes) via gosu. However, the CMD/ENTRYPOINT in the image can be overridden in compose.yml without including entrypoint.sh, silently bypassing the privilege drop.
Example misconfiguration:
# Missing entrypoint.sh — processes run as root
entrypoint: [tini, -g, --, /opt/data/bin/start-all-profiles.sh]
The correct form:
entrypoint: [tini, -g, --, /opt/hermes/docker/entrypoint.sh, /opt/data/bin/start-all-profiles.sh]
Impact
When gateway processes run as root they create files (gateway.lock, gateway.pid, profile lockfiles) owned by root:root. After the misconfiguration is corrected and the container restarts with entrypoint.sh, those files are left behind. The dashboard (uid 10000) then fails to open them, causing HTTP 500 on /api/status (see issue #18935) and the events feed disconnected UI error.
Suggestions
- Documentation: add a warning in the compose/deployment docs that the entrypoint override must always include
entrypoint.sh.
- Defensive check in
entrypoint.sh: if running as root and about to exec a non-entrypoint binary, warn or refuse.
start-all-profiles.sh self-check: assert $(id -u) != 0 at startup and exit with a clear error if run as root.
Environment
- Image:
nousresearch/hermes-agent:latest (v0.12.0)
- Deployment: Docker Compose with shared volume
./data:/opt/data
Related
Problem
The official Docker image has
entrypoint.shwhich drops from root → uid 10000 (hermes) viagosu. However, theCMD/ENTRYPOINTin the image can be overridden incompose.ymlwithout includingentrypoint.sh, silently bypassing the privilege drop.Example misconfiguration:
The correct form:
Impact
When gateway processes run as root they create files (
gateway.lock,gateway.pid, profile lockfiles) owned byroot:root. After the misconfiguration is corrected and the container restarts withentrypoint.sh, those files are left behind. The dashboard (uid 10000) then fails to open them, causing HTTP 500 on/api/status(see issue #18935) and theevents feed disconnectedUI error.Suggestions
entrypoint.sh.entrypoint.sh: if running as root and about to exec a non-entrypoint binary, warn or refuse.start-all-profiles.shself-check: assert$(id -u) != 0at startup and exit with a clear error if run as root.Environment
nousresearch/hermes-agent:latest(v0.12.0)./data:/opt/dataRelated