code: def get_docker_host():
      """Discover remote docker host address (if applicable) or use "localhost"
  
      Use "docker context inspect" to read current docker host endpoint url,
      url must start with "tcp://"
  
      Args:
  
      Returns:
          docker_host (str): Docker host DNS or IP address
      """
      cmd = "docker context inspect".split()
      process = subprocess.Popen(
          cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE
      )
      output, err = process.communicate()
      if err:
          return "localhost"
      docker_context_string = output.decode("utf-8")
      docker_context_host_url = json.loads(docker_context_string)[0][
          "Endpoints"
      ]["docker"]["Host"]
      parsed_url = urlparse(docker_context_host_url)
      if parsed_url.hostname and parsed_url.scheme == "tcp":
          return parsed_url.hostname
      return "localhost"
  
file_path: sagemaker-python-sdk/src/sagemaker/local/utils.py
imports: from __future__ import absolute_import
  import os
  import logging
  import shutil
  import subprocess
  import json
  import re
  import errno
  from distutils.dir_util import copy_tree
  from six.moves.urllib.parse import urlparse
  from sagemaker import s3
label_desc: Use image node_id 6 for calling a global function with example usage: get_docker_host() and returns: str, str, parsed_url