public String execForService(String serviceName, String... command) {
    ContainerState container = composeContainer.getContainerByServiceName(serviceName + "_1")
        .orElseThrow(() -> new IllegalArgumentException("Unknown service name: " + serviceName));
    Container.ExecResult result;
    try {
      result = container.execInContainer(command);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }

    return result.getExitCode() == 0 ? result.getStdout() : result.getStderr();
  }
Execute a command in a service container

@return the stdout of the container if the command was successful, else the stderr
geode-assembly/src/acceptanceTest/java/org/apache/geode/rules/DockerComposeRule.java