private CredentialOutput runCredentialProgram(String hostName, String credentialHelperName)
        throws InterruptedException, TimeoutException, IOException {
        String[] command = SystemUtils.IS_OS_WINDOWS
            ? new String[] { "cmd", "/c", credentialHelperName, "get" }
            : new String[] { credentialHelperName, "get" };

        StringBuffer stdout = new StringBuffer();
        StringBuffer stderr = new StringBuffer();

        ProcessResult processResult = new ProcessExecutor()
            .command(command)
            .redirectInput(new ByteArrayInputStream(hostName.getBytes()))
            .redirectOutput(
                new LogOutputStream() {
                    @Override
                    protected void processLine(String line) {
                        stdout.append(line).append(System.lineSeparator());
                    }
                }
            )
            .redirectError(
                new LogOutputStream() {
                    @Override
                    protected void processLine(String line) {
                        stderr.append(line).append(System.lineSeparator());
                    }
                }
            )
            .timeout(30, TimeUnit.SECONDS)
            .execute();
        int exitValue = processResult.getExitValue();

        return new CredentialOutput(exitValue, stdout.toString(), stderr.toString());
    }
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