private void runConsulCommands() {
        if (!initCommands.isEmpty()) {
            String commands = initCommands
                .stream()
                .map(command -> "consul " + command)
                .collect(Collectors.joining(" && "));
            try {
                ExecResult execResult = this.execInContainer(new String[] { "/bin/sh", "-c", commands });
                if (execResult.getExitCode() != 0) {
                    logger()
                        .error(
                            "Failed to execute these init commands {}. Exit code {}. Stdout {}. Stderr {}",
                            initCommands,
                            execResult.getExitCode(),
                            execResult.getStdout(),
                            execResult.getStderr()
                        );
                }
            } catch (IOException | InterruptedException e) {
                logger()
                    .error(
                        "Failed to execute these init commands {}. Exception message: {}",
                        initCommands,
                        e.getMessage()
                    );
            }
        }
    }
Testcontainers implementation for Consul.
<p>
Supported images: {@code hashicorp/consul}, {@code consul}
<p>
Exposed ports:
<ul>
    <li>HTTP: 8500</li>
    <li>gRPC: 8502</li>
</ul>
modules/consul/src/main/java/org/testcontainers/consul/ConsulContainer.java