public static String runShellCommand(String... command) {
        String joinedCommand = String.join(" ", command);
        LOGGER.debug("Executing shell command: `{}`", joinedCommand);

        try {
            ProcessResult result = new ProcessExecutor().command(command).readOutput(true).exitValueNormal().execute();

            return result.outputUTF8().trim();
        } catch (IOException | InterruptedException | TimeoutException | InvalidExitValueException e) {
            throw new ShellCommandException("Exception when executing " + joinedCommand, e);
        }
    }
Run a shell command synchronously.

@param command command to run and arguments
@return the stdout output of the command
core/src/main/java/org/testcontainers/utility/CommandLine.java