private AuthConfig runCredentialProvider(String hostName, String helperOrStoreName) throws Exception {
        if (StringUtils.isBlank(hostName)) {
            log.debug("There is no point in locating AuthConfig for blank hostName. Returning NULL to allow fallback");
            return null;
        }

        final String credentialProgramName = getCredentialProgramName(helperOrStoreName);
        final CredentialOutput data;

        log.debug(
            "Executing docker credential provider: {} to locate auth config for: {}",
            credentialProgramName,
            hostName
        );

        try {
            data = runCredentialProgram(hostName, credentialProgramName);
            if (data.getExitValue() == 1) {
                final String responseErrorMsg = data.getStdout();

                if (!StringUtils.isBlank(responseErrorMsg)) {
                    String credentialsNotFoundMsg = getGenericCredentialsNotFoundMsg(
                        responseErrorMsg,
                        credentialProgramName
                    );
                    if (credentialsNotFoundMsg != null && credentialsNotFoundMsg.equals(responseErrorMsg)) {
                        log.info(
                            "Credential helper/store ({}) does not have credentials for {}",
                            credentialProgramName,
                            hostName
                        );

                        return null;
                    }

                    log.debug(
                        "Failure running docker credential helper/store ({}) with output '{}' and error '{}'",
                        credentialProgramName,
                        responseErrorMsg,
                        data.getStderr()
                    );
                } else {
                    log.debug("Failure running docker credential helper/store ({})", credentialProgramName);
                }

                throw new InvalidResultException(data.getStdout(), null);
            }
        } catch (Exception e) {
            log.debug("Failure running docker credential helper/store ({})", credentialProgramName);
            throw e;
        }

        final JsonNode helperResponse = OBJECT_MAPPER.readTree(data.getStdout());
        log.debug("Credential helper/store provided auth config for: {}", hostName);

        final String username = helperResponse.at("/Username").asText();
        final String password = helperResponse.at("/Secret").asText();
        final String serverUrl = helperResponse.at("/ServerURL").asText();
        final AuthConfig authConfig = new AuthConfig().withRegistryAddress(serverUrl.isEmpty() ? hostName : serverUrl);
        if ("<token>".equals(username)) {
            return authConfig.withIdentityToken(password);
        } else {
            return authConfig.withUsername(username).withPassword(password);
        }
    }
Looks up an AuthConfig for a given image name.
<p>
Lookup is performed in following order, as per
https://docs.docker.com/engine/reference/commandline/cli/:
<ol>
    <li>{@code credHelpers}</li>
    <li>{@code credsStore}</li>
    <li>Hard-coded Base64 encoded auth in {@code auths}</li>
    <li>otherwise, if no credentials have been found then behaviour falls back to docker-java's
    implementation</li>
</ol>

@param dockerImageName image name to be looked up (potentially including a registry URL part)
@param defaultAuthConfig an AuthConfig object that should be returned if there is no overriding authentication available for images that are looked up
@return an AuthConfig that is applicable to this specific image OR the defaultAuthConfig.
core/src/main/java/org/testcontainers/utility/RegistryAuthLocator.java