From 178c6c67a3941977e5a16a6622d740dd9fc9c0f3 Mon Sep 17 00:00:00 2001 From: Karma Riuk Date: Sat, 1 Mar 2025 12:37:21 +0100 Subject: [PATCH] made the container owned by the current user, so that it doesn't create anything as root --- clone_repos.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/clone_repos.py b/clone_repos.py index 872df13..17a4d0a 100644 --- a/clone_repos.py +++ b/clone_repos.py @@ -5,6 +5,9 @@ import shutil tqdm.pandas() +USER_ID = os.getuid() # for container user +GROUP_ID = os.getgid() + EXCLUSION_LIST = [ "edmcouncil/idmp", # requires authentication "aosp-mirror/platform_frameworks_base", # takes ages to clone @@ -212,6 +215,7 @@ def process_row(repo, client, dest: str, updates: dict, force: bool = False, ver image="crab-java-env", command="tail -f /dev/null", volumes={os.path.abspath(repo_path): {"bind": "/repo", "mode": "rw"}}, + user=f"{USER_ID}:{GROUP_ID}", detach=True, tty=True )