From 623edeac76d3a894b27d6d9f2160b7539b132432 Mon Sep 17 00:00:00 2001 From: Mathieu Virbel Date: Wed, 2 Apr 2025 17:21:56 -0600 Subject: [PATCH] fix(uid): correctly pass uid/gid to project --- mcontainer/container.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/mcontainer/container.py b/mcontainer/container.py index bc38002..bbc3f44 100644 --- a/mcontainer/container.py +++ b/mcontainer/container.py @@ -188,11 +188,9 @@ class ContainerManager: # Prepare environment variables env_vars = environment or {} - # Add TARGET_UID and TARGET_GID for entrypoint script - if uid is not None: - env_vars["TARGET_UID"] = str(uid) - if gid is not None: - env_vars["TARGET_GID"] = str(gid) + # Add MC_USER_ID and MC_GROUP_ID for entrypoint script + env_vars["MC_USER_ID"] = str(uid) if uid is not None else "1000" + env_vars["MC_GROUP_ID"] = str(gid) if gid is not None else "1000" # Set SSH environment variable env_vars["MC_SSH_ENABLED"] = "true" if ssh else "false"