diff --git a/python/ray/autoscaler/_private/command_runner.py b/python/ray/autoscaler/_private/command_runner.py index d37d16382..3b3692a2c 100644 --- a/python/ray/autoscaler/_private/command_runner.py +++ b/python/ray/autoscaler/_private/command_runner.py @@ -669,8 +669,7 @@ class DockerCommandRunner(CommandRunnerInterface): if user_pos > -1: if self.home_dir is None: self.home_dir = self.ssh_command_runner.run( - "docker exec {} env | grep HOME | cut -d'=' -f2".format( - self.container_name), + f"docker exec {self.container_name} printenv HOME", with_output=True).decode("utf-8").strip() if any_char: