@VisibleForTesting
  CredentialRetriever dockerConfig(
      DockerConfigCredentialRetriever dockerConfigCredentialRetriever) {
    return () -> {
      Path configFile = dockerConfigCredentialRetriever.getDockerConfigFile();
      try {
        Optional<Credential> credentials = dockerConfigCredentialRetriever.retrieve(logger);
        if (credentials.isPresent()) {
          logGotCredentialsFrom("credentials from Docker config (" + configFile + ")");
          return credentials;
        }

      } catch (IOException ex) {
        logger.accept(LogEvent.info("Unable to parse Docker config file: " + configFile));
      }
      return Optional.empty();
    };
  }
Creates a new {@link CredentialRetriever} that tries to retrieve credentials from <a
href="https://cloud.google.com/docs/authentication/production">Google Application Default
Credentials</a>.

@return a new {@link CredentialRetriever}
@see <a
    href="https://cloud.google.com/docs/authentication/production">https://cloud.google.com/docs/authentication/production</a>
jib-core/src/main/java/com/google/cloud/tools/jib/frontend/CredentialRetrieverFactory.java