public static String fetchDockerHostForHttpRequest() {
    if (System.getenv("KOKORO_JOB_CLUSTER") != null
        && System.getenv("KOKORO_JOB_CLUSTER").equals("MACOS_EXTERNAL")) {
      return System.getenv("DOCKER_IP");
    } else if (System.getenv("KOKORO_JOB_CLUSTER") != null
        && System.getenv("KOKORO_JOB_CLUSTER").equals("GCP_UBUNTU_DOCKER")) {
      return System.getenv("DOCKER_IP_UBUNTU");
    } else {
      return "localhost";
    }
  }
Fetches the host to use for the http request.
jib-cli/src/test/java/com/google/cloud/tools/jib/api/HttpRequestTester.java