code: def run_in_container(cmds: List[List[str]], container_id: str):
      outputs = []
      for cmd in cmds:
          docker_cmd = ["docker", "exec", container_id] + cmd
          print(f"Executing command: {docker_cmd}", time.time())
          resp = subprocess.check_output(
              docker_cmd, stderr=subprocess.STDOUT
          )
          output = resp.decode("utf-8").strip()
          print(f"Output: {output}")
          outputs.append(output)
  
      return outputs
  
file_path: ray/python/ray/tests/conftest_docker.py
imports: import time
  import pytest
  from pytest_docker_tools import container, fetch, network, volume
  from pytest_docker_tools import wrappers
  import subprocess
  from typing import List
label_desc: Use image node_id 2 for calling a global function with example usage: run_in_container(cmds, container_id) and returns: outputs