private void validateNoContainerNameSpecified(String serviceName, Map<String, ?> serviceDefinitionMap) {
        if (serviceDefinitionMap.containsKey("container_name")) {
            throw new IllegalStateException(
                String.format(
                    "Compose file %s has 'container_name' property set for service '%s' but this property is not supported by Testcontainers, consider removing it",
                    composeFileName,
                    serviceName
                )
            );
        }
    }
Representation of a docker-compose file, with partial parsing for validation and extraction of a minimal set of
data.
core/src/main/java/org/testcontainers/containers/ParsedDockerComposeFile.java