code: def _fixPermissions(tool, workDir):
      
      if os.geteuid() == 0:
          # we're running as root so this chown is redundant
          return
  
      baseDockerCall = ['docker', 'run', '--log-driver=none',
                        '-v', os.path.abspath(workDir) + ':/data', '--rm',
                        '--entrypoint=chown']
      stat = os.stat(workDir)
      command = baseDockerCall + [tool] + ['-R', '{}:{}'.format(stat.st_uid,
                                                                stat.st_gid),
                                           '/data']
      for attempt in retry(predicate=dockerPredicate):
          with attempt:
              subprocess.check_call(command)
docs: Deprecated.
  
      Fix permission of a mounted Docker directory by reusing the tool to change
      ownership.  Docker natively runs as a root inside the container, and files
      written to the mounted directory are implicitly owned by root.
      :param list baseDockerCall: Docker run parameters
      :param str tool: Name of tool
      :param str workDir: Path of work directory to recursively chown