Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -68,5 +68,21 @@ os.chmod(path, 0o600)"
RUN openclaw doctor --fix > /dev/null 2>&1 || true \
&& openclaw plugins install /opt/nemoclaw > /dev/null 2>&1 || true

# Restore sandbox ownership and writability on /sandbox/.openclaw. Two things
# go wrong here without this step:
# 1. `openshell sandbox create --from Dockerfile` builds the image in an
# environment that does not always honor USER directives — RUN steps
# above can execute as root, leaving root-owned state under .openclaw.
# 2. `openclaw doctor --fix` writes openclaw.json as mode 0444, which
# blocks the runtime process (uid 998 sandbox) from rewriting its own
# config even when it owns the file.
# Do the chown + u+w explicitly as root so the final image is usable by the
# non-root sandbox user at runtime regardless of what the intermediate
# layers did.
USER root
RUN chown -R sandbox:sandbox /sandbox/.openclaw /sandbox/.nemoclaw \
&& chmod -R u+w /sandbox/.openclaw
USER sandbox

ENTRYPOINT ["/bin/bash"]
CMD []