Skip to content

Run CARLA physics container as non-root user#11

Merged
hakuturu583 merged 1 commit into
tier4-devfrom
fix/carla-nonroot
Jul 15, 2026
Merged

Run CARLA physics container as non-root user#11
hakuturu583 merged 1 commit into
tier4-devfrom
fix/carla-nonroot

Conversation

@hakuturu583

Copy link
Copy Markdown
Collaborator

Summary

  • docker/carla/physics.Dockerfile now creates a dedicated carla system user (UID/GID configurable via CARLA_UID/CARLA_GID build args) and switches to it before ENTRYPOINT.
  • Grants ownership of /opt/carla, /work, and /home/carla so CarlaUE4.sh can still write into Saved/ and xdg-user-dirs has a writable $HOME.
  • No functional change to the entrypoint or wheels installed in the runtime venv.

Motivation

CarlaUE4 was running as root, which is unnecessary for the Unreal server and violates the principle of least privilege. Running as an unprivileged user keeps container escapes and rogue writes contained.

Test plan

  • docker build --check -f docker/carla/physics.Dockerfile . — clean
  • pre-commit run --files docker/carla/physics.Dockerfile
  • Full image build + physics=carla wizard profile smoke test (CI)

🤖 Generated with Claude Code

CarlaUE4 previously ran as root, which is unnecessary and violates the
principle of least privilege. Create a dedicated system user "carla",
give it ownership of the CARLA install tree and workdir, set HOME so
xdg-user-dirs writes land in a writable location, and drop to that user
before ENTRYPOINT.

CARLA_UID / CARLA_GID build args let callers align the in-container UID
with a host user when bind-mounting.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@hakuturu583
hakuturu583 merged commit 1c46bde into tier4-dev Jul 15, 2026
4 checks passed
@hakuturu583
hakuturu583 deleted the fix/carla-nonroot branch July 15, 2026 23:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant