Comment From: wilkinsona
Redpanda has problems that are similar to those that we had with Kafka:
It doesn't appear to be possible with the official image (confluentinc/cp-kafka) as Kafka cannot be configured within the compose YAML to advertise the ephemeral port. Testcontainers works around this by dynamically exporting the KAFKA_ADVERTISED_LISTENERS in the container when it's starting up and after the port mapping has been performed. I don't think such an approach is possible with Docker Compose.
Testcontainers does a similar trick when the Redpanda container is startup in, exporting --advertise-kafka-addr once the port mappings are in place but before the container is actually started.
As with Kafka, we don't want to try to support this at the moment.