From b3fb3a73686879e6fbb6ba502cacd971614669cb Mon Sep 17 00:00:00 2001 From: prosumer Date: Sun, 22 Feb 2026 00:56:38 +0800 Subject: [PATCH 01/10] Improves Docker multi-user isolation with suffix-based compose namespaces Defaults omitted --suffix to a user-derived suffix, sets COMPOSE_PROJECT_NAME to isolate compose projects, and adds conflict detection before start while preserving legacy behavior with --suffix ''. Signed-off-by: prosumer --- docker/container.py | 10 ++-- docker/utils/container_interface.py | 88 ++++++++++++++++++++++++++--- 2 files changed, 86 insertions(+), 12 deletions(-) diff --git a/docker/container.py b/docker/container.py index ab92d816ffa..29e0c217524 100755 --- a/docker/container.py +++ b/docker/container.py @@ -51,10 +51,12 @@ def parse_cli_args() -> argparse.Namespace: nargs="?", default=None, help=( - "Optional docker image and container name suffix. Defaults to None, in which case, the docker name" - " suffix is set to the empty string. A hyphen is inserted in between the profile and the suffix if" - ' the suffix is a nonempty string. For example, if "base" is passed to profile, and "custom" is' - " passed to suffix, then the produced docker image and container will be named ``isaac-lab-base-custom``." + "Optional docker image and container name suffix. If omitted (default), a per-user suffix" + " derived from the current username is used to avoid name collisions in multi-user environments." + " If you explicitly pass an empty string (``--suffix ''``), the old behavior (no suffix) is preserved." + " A hyphen is inserted between the profile and the suffix when a nonempty suffix is used." + " For example, with profile 'base' and suffix 'custom' the container will be named" + " ``isaac-lab-base-custom``." ), ) parent_parser.add_argument( diff --git a/docker/utils/container_interface.py b/docker/utils/container_interface.py index f8b3eb07ee2..0ec9762b87d 100644 --- a/docker/utils/container_interface.py +++ b/docker/utils/container_interface.py @@ -5,6 +5,8 @@ from __future__ import annotations +import getpass +import json import os import shutil import subprocess @@ -44,10 +46,10 @@ def __init__( which case a new configuration object is created by reading the configuration file at the path ``context_dir/.container.cfg``. suffix: - Optional docker image and container name suffix. Defaults to None, in which case, the docker name - suffix is set to the empty string. A hyphen is inserted in between the profile and the suffix if - the suffix is a nonempty string. For example, if "base" is passed to profile, and "custom" is - passed to suffix, then the produced docker image and container will be named ``isaac-lab-base-custom``. + Optional docker image/container name suffix. + If omitted (``None``), a username-based suffix is used to avoid collisions in multi-user setups. + If explicitly set to an empty string, legacy no-suffix behavior is preserved. + For non-empty values, a hyphen is inserted before the suffix. """ # set the context directory self.context_dir = context_dir @@ -66,12 +68,17 @@ def __init__( # but not a real profile self.profile = "base" - # set the docker image and container name suffix - if suffix is None or suffix == "": - # if no name suffix is given, default to the empty string as the name suffix + if suffix == "": + # explicit empty string -> preserve legacy behavior (no suffix) self.suffix = "" + elif suffix is None: + # no suffix provided -> default to current user to avoid name collisions in multi-user environments + user = getpass.getuser() + # sanitize username to be safe for docker names (replace problematic chars) + safe_user = "".join(c if c.isalnum() or c in ["-", "_"] else "_" for c in user) + self.suffix = f"-{safe_user}" else: - # insert a hyphen before the suffix if a suffix is given + # insert a hyphen before the provided suffix self.suffix = f"-{suffix}" # set names for easier reference @@ -85,6 +92,13 @@ def __init__( self.environ = os.environ.copy() self.environ["DOCKER_NAME_SUFFIX"] = self.suffix + # Ensure docker compose operates in a per-user project namespace so multiple users + # running `docker compose up` in the same directory won't recreate each other's containers. + # Use COMPOSE_PROJECT_NAME to override the project name used by docker compose. + # If suffix is empty (legacy behavior), keep the base project name `isaac-lab`. + project_name = f"isaac-lab{self.suffix}".replace("--", "-").rstrip("-") + self.environ["COMPOSE_PROJECT_NAME"] = project_name + # resolve the image extension through the passed yamls and envs self._resolve_image_extension(yamls, envs) # load the environment variables from the .env files @@ -166,6 +180,23 @@ def build(self): def start(self): """Build and start the Docker container using the Docker compose command.""" + # detect potential conflicting containers from other users/projects + conflicts = self._detect_conflicting_containers() + if conflicts: + print("[ERROR] Found existing containers that may conflict with this start:") + for c in conflicts: + print(f" - {c}") + print( + "\nTo avoid unintentionally recreating others' containers, choose one of the following:\n" + " * Start with an explicit --suffix (e.g. --suffix yourname) to create an isolated container.\n" + " * Start with `--suffix ''` to intentionally use the shared legacy container (not recommended).\n" + " * If you are sure, set the environment variable ISAACLAB_FORCE_START=1 to override and proceed.\n" + ) + # allow forced start via environment variable + if os.environ.get("ISAACLAB_FORCE_START") == "1": + print("[WARN] ISAACLAB_FORCE_START=1 set — proceeding despite conflicts.") + else: + raise RuntimeError("Aborting start due to potential container conflicts.") print( f"[INFO] Building the docker image and starting the container '{self.container_name}' in the" " background...\n" @@ -293,6 +324,47 @@ def config(self, output_yaml: Path | None = None): cmd = ["docker", "compose"] + self.add_yamls + self.add_profiles + self.add_env_files + ["config"] + output subprocess.run(cmd, check=False, cwd=self.context_dir, env=self.environ) + def _detect_conflicting_containers(self) -> list[str]: + """Detect existing containers in the same compose project namespace.""" + try: + result = subprocess.run( + ["docker", "ps", "-a", "--format", "{{.Names}}"], capture_output=True, text=True, check=False + ) + names = [n.strip() for n in result.stdout.splitlines() if n.strip()] + except Exception: + return [] + + project_name = self.environ.get("COMPOSE_PROJECT_NAME", "isaac-lab") + conflicts: list[str] = [] + + for n in names: + if n == self.container_name: + continue + + # inspect labels to see which compose project this container belongs to + try: + out = subprocess.run( + ["docker", "inspect", "--format", "{{json .Config.Labels}}", n], + capture_output=True, + text=True, + check=False, + ).stdout + labels = json.loads(out) if out else {} + except Exception: + labels = {} + + comp_proj = labels.get("com.docker.compose.project") + if comp_proj == project_name: + conflicts.append(n) + continue + + # Compatibility: if the container belongs to the legacy 'isaac-lab' project and + # we are starting with an explicit empty suffix (legacy mode), treat as conflict. + if comp_proj == "isaac-lab" and self.suffix == "": + conflicts.append(n) + + return conflicts + """ Helper functions. """ From 3688212bc82e9433387128c9e1e29ad2b06aa287 Mon Sep 17 00:00:00 2001 From: prosumer Date: Sun, 22 Feb 2026 01:44:12 +0800 Subject: [PATCH 02/10] Updates Docker deployment docs and release metadata for multi-user isolation Documents default and explicit suffix semantics, adds conflict-check guidance, and aligns release bookkeeping for this Docker behavior change. Signed-off-by: prosumer --- CONTRIBUTORS.md | 1 + docs/source/deployment/docker.rst | 38 +++++++++++++++++++++++------- source/isaaclab/docs/CHANGELOG.rst | 11 +++++++++ 3 files changed, 42 insertions(+), 8 deletions(-) diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 6a96c1bf6be..aafade12061 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -77,6 +77,7 @@ Guidelines for modifications: * Gary Lvov * Giulio Romualdi * Grzegorz Malczyk +* Guanpeng Long * Haoran Zhou * Harsh Patel * HoJin Jeon diff --git a/docs/source/deployment/docker.rst b/docs/source/deployment/docker.rst index 198c84a7cce..206c46f0e5a 100644 --- a/docs/source/deployment/docker.rst +++ b/docs/source/deployment/docker.rst @@ -238,21 +238,33 @@ Only one image extension can be passed at a time. The produced image and contai ``isaac-lab-${profile}``, where ``${profile}`` is the image extension name. ``suffix`` is an optional string argument to ``container.py`` that specifies a docker image and -container name suffix, which can be useful for development purposes. By default ``${suffix}`` is the empty string. -If ``${suffix}`` is a nonempty string, then the produced docker image and container will be named -``isaac-lab-${profile}-${suffix}``, where a hyphen is inserted between ``${profile}`` and ``${suffix}`` in -the name. ``suffix`` should not be used with cluster deployments. +container name suffix, which is useful for local development in multi-user environments: + +* If ``--suffix`` is omitted, Isaac Lab uses a per-user suffix derived from the current username. + This creates names such as ``isaac-lab-base-`` and isolates Docker Compose projects by user. +* If ``--suffix ''`` is passed explicitly, Isaac Lab preserves the legacy no-suffix behavior + (for example, ``isaac-lab-base``). +* If ``--suffix `` is provided, Isaac Lab inserts a hyphen and uses + ``isaac-lab-${profile}-${suffix}``. + +``suffix`` should not be used with cluster deployments. .. code:: bash - # start base by default, named isaac-lab-base + # start base with the default user-derived suffix (for example, isaac-lab-base-gplong) ./docker/container.py start - # stop base explicitly, named isaac-lab-base + # stop base with the same default user-derived suffix ./docker/container.py stop base + + # explicitly preserve legacy behavior (no suffix), named isaac-lab-base + ./docker/container.py start base --suffix '' + # stop base explicitly, named isaac-lab-base + ./docker/container.py stop base --suffix '' + # start ros2 container named isaac-lab-ros2 - ./docker/container.py start ros2 + ./docker/container.py start ros2 --suffix '' # stop ros2 container named isaac-lab-ros2 - ./docker/container.py stop ros2 + ./docker/container.py stop ros2 --suffix '' # start base container named isaac-lab-base-custom ./docker/container.py start base --suffix custom @@ -263,6 +275,16 @@ the name. ``suffix`` should not be used with cluster deployments. # stop ros2 container named isaac-lab-ros2-custom ./docker/container.py stop ros2 --suffix custom +When starting a container, Isaac Lab checks whether another container from the same Docker Compose +project is already running. This prevents accidental recreation of containers owned by another user +or another shell session. + +If you intentionally want to proceed despite a detected conflict, set ``ISAACLAB_FORCE_START=1``: + +.. code:: bash + + ISAACLAB_FORCE_START=1 ./docker/container.py start + The passed image extension argument will build the image defined in ``Dockerfile.${image_extension}``, with the corresponding `profile`_ in the ``docker-compose.yaml`` and the envars from ``.env.${image_extension}`` in addition to the ``.env.base``, if any. diff --git a/source/isaaclab/docs/CHANGELOG.rst b/source/isaaclab/docs/CHANGELOG.rst index 2ed57016c78..b53f3a0b901 100644 --- a/source/isaaclab/docs/CHANGELOG.rst +++ b/source/isaaclab/docs/CHANGELOG.rst @@ -16,6 +16,10 @@ Changed for warp array properties and write methods, ensuring consistent documentation between PhysX and Newton backend implementations. +* Improved Docker multi-user container isolation by making omitted ``--suffix`` default to a + user-derived value, propagating this suffix to ``COMPOSE_PROJECT_NAME``, and adding startup + conflict detection with support for explicit legacy mode (``--suffix ''``). + 4.1.0 (2026-02-18) ~~~~~~~~~~~~~~~~~~ @@ -499,6 +503,13 @@ Changed 0.54.4 (2026-02-04) +======= +* Improved Docker multi-user isolation behavior by making omitted ``--suffix`` default to a + user-derived suffix, propagating it to Compose project naming, and adding pre-start conflict + detection while preserving legacy behavior for explicit ``--suffix ''``. + +0.54.3 (2026-02-04) +>>>>>>> 8aa25a8966c (Updates Docker deployment docs and release metadata for multi-user isolation) ~~~~~~~~~~~~~~~~~~~ Fixed From 17900706ca32086d65138f24c86009923062986e Mon Sep 17 00:00:00 2001 From: prosumer Date: Sun, 22 Feb 2026 02:09:43 +0800 Subject: [PATCH 03/10] Hardens Docker suffix normalization edge cases Handle empty or unavailable usernames with a stable fallback and normalize compose project names by collapsing repeated hyphens. Signed-off-by: prosumer --- docker/utils/container_interface.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/docker/utils/container_interface.py b/docker/utils/container_interface.py index 0ec9762b87d..5fb3af0c44c 100644 --- a/docker/utils/container_interface.py +++ b/docker/utils/container_interface.py @@ -8,6 +8,7 @@ import getpass import json import os +import re import shutil import subprocess from pathlib import Path @@ -73,9 +74,14 @@ def __init__( self.suffix = "" elif suffix is None: # no suffix provided -> default to current user to avoid name collisions in multi-user environments - user = getpass.getuser() + try: + user = getpass.getuser() + except Exception: + user = "" # sanitize username to be safe for docker names (replace problematic chars) safe_user = "".join(c if c.isalnum() or c in ["-", "_"] else "_" for c in user) + if not safe_user: + safe_user = "user" self.suffix = f"-{safe_user}" else: # insert a hyphen before the provided suffix @@ -96,7 +102,7 @@ def __init__( # running `docker compose up` in the same directory won't recreate each other's containers. # Use COMPOSE_PROJECT_NAME to override the project name used by docker compose. # If suffix is empty (legacy behavior), keep the base project name `isaac-lab`. - project_name = f"isaac-lab{self.suffix}".replace("--", "-").rstrip("-") + project_name = re.sub(r"-+", "-", f"isaac-lab{self.suffix}").rstrip("-") self.environ["COMPOSE_PROJECT_NAME"] = project_name # resolve the image extension through the passed yamls and envs From f842c72670a5908f0d1c2359c1d6b6e46caed0ef Mon Sep 17 00:00:00 2001 From: prosumer Date: Thu, 26 Feb 2026 02:33:20 +0800 Subject: [PATCH 04/10] Fix unresolved changelog merge markers Remove accidental conflict markers in the 0.54.4/0.54.3 section and restore valid reStructuredText changelog structure. Signed-off-by: prosumer --- source/isaaclab/docs/CHANGELOG.rst | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/source/isaaclab/docs/CHANGELOG.rst b/source/isaaclab/docs/CHANGELOG.rst index b53f3a0b901..11f57397a22 100644 --- a/source/isaaclab/docs/CHANGELOG.rst +++ b/source/isaaclab/docs/CHANGELOG.rst @@ -503,13 +503,16 @@ Changed 0.54.4 (2026-02-04) -======= +~~~~~~~~~~~~~~~~~~~ + +Changed +^^^^^^^ + * Improved Docker multi-user isolation behavior by making omitted ``--suffix`` default to a user-derived suffix, propagating it to Compose project naming, and adding pre-start conflict detection while preserving legacy behavior for explicit ``--suffix ''``. 0.54.3 (2026-02-04) ->>>>>>> 8aa25a8966c (Updates Docker deployment docs and release metadata for multi-user isolation) ~~~~~~~~~~~~~~~~~~~ Fixed From e93c5a0025122f925bd7fc2da77db22f0c31ac04 Mon Sep 17 00:00:00 2001 From: prosumer Date: Thu, 26 Feb 2026 02:42:09 +0800 Subject: [PATCH 05/10] Removes duplicate legacy Docker changelog entry Keeps the Docker multi-user isolation note in the active 4.2.0 section and drops the duplicate 0.54.4 entry to avoid version-line ambiguity. Signed-off-by: prosumer --- source/isaaclab/docs/CHANGELOG.rst | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/source/isaaclab/docs/CHANGELOG.rst b/source/isaaclab/docs/CHANGELOG.rst index 11f57397a22..72b6bfc9a34 100644 --- a/source/isaaclab/docs/CHANGELOG.rst +++ b/source/isaaclab/docs/CHANGELOG.rst @@ -502,16 +502,6 @@ Changed * Changed :class:`~isaaclab.utils.timer.Timer` class to use the online Welford's algorithm to compute the mean and standard deviation of the elapsed time. -0.54.4 (2026-02-04) -~~~~~~~~~~~~~~~~~~~ - -Changed -^^^^^^^ - -* Improved Docker multi-user isolation behavior by making omitted ``--suffix`` default to a - user-derived suffix, propagating it to Compose project naming, and adding pre-start conflict - detection while preserving legacy behavior for explicit ``--suffix ''``. - 0.54.3 (2026-02-04) ~~~~~~~~~~~~~~~~~~~ From 65f3a6ef1a4c81cf7a59bce420fa546318214e50 Mon Sep 17 00:00:00 2001 From: prosumer Date: Thu, 26 Feb 2026 02:54:24 +0800 Subject: [PATCH 06/10] Fix changelog heading for 0.54.4 entry Restore the 2026-02-04 heading to 0.54.4 to avoid duplicate 0.54.3 sections after conflict cleanup. Signed-off-by: prosumer --- source/isaaclab/docs/CHANGELOG.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/isaaclab/docs/CHANGELOG.rst b/source/isaaclab/docs/CHANGELOG.rst index 72b6bfc9a34..cd94d0156e7 100644 --- a/source/isaaclab/docs/CHANGELOG.rst +++ b/source/isaaclab/docs/CHANGELOG.rst @@ -502,7 +502,7 @@ Changed * Changed :class:`~isaaclab.utils.timer.Timer` class to use the online Welford's algorithm to compute the mean and standard deviation of the elapsed time. -0.54.3 (2026-02-04) +0.54.4 (2026-02-04) ~~~~~~~~~~~~~~~~~~~ Fixed From ab995858b215d03cf234e70e341ec2104b1c3dfa Mon Sep 17 00:00:00 2001 From: Guanpeng Long Date: Thu, 26 Feb 2026 14:59:18 +0800 Subject: [PATCH 07/10] Improve docker compose conflict detection Signed-off-by: Guanpeng Long --- docker/utils/container_interface.py | 41 +++++++++++++++++++---------- 1 file changed, 27 insertions(+), 14 deletions(-) diff --git a/docker/utils/container_interface.py b/docker/utils/container_interface.py index 5fb3af0c44c..33af15b684b 100644 --- a/docker/utils/container_interface.py +++ b/docker/utils/container_interface.py @@ -98,10 +98,6 @@ def __init__( self.environ = os.environ.copy() self.environ["DOCKER_NAME_SUFFIX"] = self.suffix - # Ensure docker compose operates in a per-user project namespace so multiple users - # running `docker compose up` in the same directory won't recreate each other's containers. - # Use COMPOSE_PROJECT_NAME to override the project name used by docker compose. - # If suffix is empty (legacy behavior), keep the base project name `isaac-lab`. project_name = re.sub(r"-+", "-", f"isaac-lab{self.suffix}").rstrip("-") self.environ["COMPOSE_PROJECT_NAME"] = project_name @@ -332,22 +328,45 @@ def config(self, output_yaml: Path | None = None): def _detect_conflicting_containers(self) -> list[str]: """Detect existing containers in the same compose project namespace.""" + project_name = self.environ.get("COMPOSE_PROJECT_NAME", "isaac-lab") + try: result = subprocess.run( - ["docker", "ps", "-a", "--format", "{{.Names}}"], capture_output=True, text=True, check=False + [ + "docker", + "ps", + "-a", + "--filter", + f"label=com.docker.compose.project={project_name}", + "--format", + "{{.Names}}", + ], + capture_output=True, + text=True, + check=False, ) - names = [n.strip() for n in result.stdout.splitlines() if n.strip()] + if result.returncode == 0: + names = [n.strip() for n in result.stdout.splitlines() if n.strip()] + return [n for n in names if n != self.container_name] except Exception: return [] - project_name = self.environ.get("COMPOSE_PROJECT_NAME", "isaac-lab") + try: + result = subprocess.run( + ["docker", "ps", "-a", "--format", "{{.Names}}"], + capture_output=True, + text=True, + check=False, + ) + names = [n.strip() for n in result.stdout.splitlines() if n.strip()] + except Exception: + return [] conflicts: list[str] = [] for n in names: if n == self.container_name: continue - # inspect labels to see which compose project this container belongs to try: out = subprocess.run( ["docker", "inspect", "--format", "{{json .Config.Labels}}", n], @@ -362,12 +381,6 @@ def _detect_conflicting_containers(self) -> list[str]: comp_proj = labels.get("com.docker.compose.project") if comp_proj == project_name: conflicts.append(n) - continue - - # Compatibility: if the container belongs to the legacy 'isaac-lab' project and - # we are starting with an explicit empty suffix (legacy mode), treat as conflict. - if comp_proj == "isaac-lab" and self.suffix == "": - conflicts.append(n) return conflicts From 04d61fbcfd5e7d0d519c9696b8492e2a42b7cd51 Mon Sep 17 00:00:00 2001 From: Guanpeng Long Date: Thu, 26 Feb 2026 15:23:49 +0800 Subject: [PATCH 08/10] Clarify Docker --suffix behavior and migration notes Signed-off-by: Guanpeng Long --- docker/container.py | 3 ++- docs/source/deployment/docker.rst | 7 +++++++ source/isaaclab/docs/CHANGELOG.rst | 3 ++- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/docker/container.py b/docker/container.py index 29e0c217524..a58d1c7dcc1 100755 --- a/docker/container.py +++ b/docker/container.py @@ -48,12 +48,13 @@ def parse_cli_args() -> argparse.Namespace: ) parent_parser.add_argument( "--suffix", - nargs="?", + type=str, default=None, help=( "Optional docker image and container name suffix. If omitted (default), a per-user suffix" " derived from the current username is used to avoid name collisions in multi-user environments." " If you explicitly pass an empty string (``--suffix ''``), the old behavior (no suffix) is preserved." + " Passing ``--suffix`` without a value is not supported; omit ``--suffix`` to use the default behavior." " A hyphen is inserted between the profile and the suffix when a nonempty suffix is used." " For example, with profile 'base' and suffix 'custom' the container will be named" " ``isaac-lab-base-custom``." diff --git a/docs/source/deployment/docker.rst b/docs/source/deployment/docker.rst index 206c46f0e5a..ac1aada5a59 100644 --- a/docs/source/deployment/docker.rst +++ b/docs/source/deployment/docker.rst @@ -242,11 +242,18 @@ container name suffix, which is useful for local development in multi-user envir * If ``--suffix`` is omitted, Isaac Lab uses a per-user suffix derived from the current username. This creates names such as ``isaac-lab-base-`` and isolates Docker Compose projects by user. +* Passing ``--suffix`` without a value is not supported. Omit the flag to use the default behavior. * If ``--suffix ''`` is passed explicitly, Isaac Lab preserves the legacy no-suffix behavior (for example, ``isaac-lab-base``). * If ``--suffix `` is provided, Isaac Lab inserts a hyphen and uses ``isaac-lab-${profile}-${suffix}``. +.. note:: + + This is a breaking change from earlier releases where omitting ``--suffix`` produced containers named + ``isaac-lab-${profile}``. If you have existing legacy containers created without a suffix, explicitly + pass ``--suffix ''`` to target them when running ``stop``/``enter``/``copy``. + ``suffix`` should not be used with cluster deployments. .. code:: bash diff --git a/source/isaaclab/docs/CHANGELOG.rst b/source/isaaclab/docs/CHANGELOG.rst index 6908a38ee7c..701dc6b4d78 100644 --- a/source/isaaclab/docs/CHANGELOG.rst +++ b/source/isaaclab/docs/CHANGELOG.rst @@ -36,7 +36,8 @@ Changed * Improved Docker multi-user container isolation by making omitted ``--suffix`` default to a user-derived value, propagating this suffix to ``COMPOSE_PROJECT_NAME``, and adding startup - conflict detection with support for explicit legacy mode (``--suffix ''``). + conflict detection with support for explicit legacy mode (``--suffix ''``). Existing legacy + containers created without a suffix can still be targeted by passing ``--suffix ''`` explicitly. 4.1.0 (2026-02-18) From 4bf6993ae35c83232a7566dcfc07d068040ea81a Mon Sep 17 00:00:00 2001 From: Guanpeng Long Date: Thu, 26 Feb 2026 15:41:47 +0800 Subject: [PATCH 09/10] Fix Docker tests for legacy empty suffix Signed-off-by: Guanpeng Long --- docker/test/test_docker.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/test/test_docker.py b/docker/test/test_docker.py index 85fd66348f8..6987878bd10 100644 --- a/docker/test/test_docker.py +++ b/docker/test/test_docker.py @@ -21,7 +21,7 @@ def start_stop_docker(profile, suffix): suffix_args = ["--suffix", suffix] else: container_name = f"isaac-lab-{profile}" - suffix_args = [] + suffix_args = ["--suffix", ""] run_kwargs = { "check": False, From e44fcbdcb4d397482db698aa6657116f8213ecc4 Mon Sep 17 00:00:00 2001 From: prosumer Date: Thu, 26 Feb 2026 15:48:23 +0800 Subject: [PATCH 10/10] Make docker conflict detection fallback explicit Signed-off-by: prosumer --- docker/utils/container_interface.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/docker/utils/container_interface.py b/docker/utils/container_interface.py index 33af15b684b..cbd43072d77 100644 --- a/docker/utils/container_interface.py +++ b/docker/utils/container_interface.py @@ -345,11 +345,12 @@ def _detect_conflicting_containers(self) -> list[str]: text=True, check=False, ) - if result.returncode == 0: - names = [n.strip() for n in result.stdout.splitlines() if n.strip()] - return [n for n in names if n != self.container_name] except Exception: - return [] + result = None + + if result is not None and result.returncode == 0: + names = [n.strip() for n in result.stdout.splitlines() if n.strip()] + return [n for n in names if n != self.container_name] try: result = subprocess.run( @@ -358,9 +359,11 @@ def _detect_conflicting_containers(self) -> list[str]: text=True, check=False, ) - names = [n.strip() for n in result.stdout.splitlines() if n.strip()] except Exception: return [] + if result.returncode != 0: + return [] + names = [n.strip() for n in result.stdout.splitlines() if n.strip()] conflicts: list[str] = [] for n in names: