public void setContainerName(String serviceName, String newName) {
    ContainerState container = composeContainer.getContainerByServiceName(serviceName + "_1")
        .orElseThrow(() -> new IllegalArgumentException("Unknown service name: " + serviceName));

    String containerId = container.getContainerId();

    DockerClient dockerClient = DockerClientFactory.instance().client();
    dockerClient.renameContainerCmd(containerId).withName(newName).exec();
  }
When used with compose, testcontainers does not allow one to have a 'container_name'
attribute in the compose file. This means that container names end up looking something like:
{@code project_service_index}. When a container performs a reverse IP lookup it will get a
hostname that looks something like {@code projectjkh_db_1.my-network}. This can be a problem
since this hostname is not RFC compliant as it contains underscores. This may cause problems
in particular with SSL.

@param serviceName the service who's container name to change
@param newName the new container name

@throws IllegalArgumentException if the service cannot be found
geode-assembly/src/acceptanceTest/java/org/apache/geode/rules/DockerComposeRule.java