public CredentialRetriever dockerCredentialHelper(Path credentialHelper) {
    return () -> {
      try {
        return Optional.of(retrieveFromDockerCredentialHelper(credentialHelper));

      } catch (CredentialHelperUnhandledServerUrlException ex) {
        logger.accept(
            LogEvent.info(
                "No credentials for " + imageReference.getRegistry() + " in " + credentialHelper));
        return Optional.empty();

      } catch (IOException ex) {
        throw new CredentialRetrievalException(ex);
      }
    };
  }
Creates a new {@link CredentialRetriever} for retrieving credentials via a Docker credential
helper, such as {@code docker-credential-gcr}.

@param credentialHelper the credential helper executable
@return a new {@link CredentialRetriever}
@see <a
    href="https://github.com/docker/docker-credential-helpers#development">https://github.com/docker/docker-credential-helpers#development</a>
jib-core/src/main/java/com/google/cloud/tools/jib/frontend/CredentialRetrieverFactory.java