When using testcontainers at development time @DynamicPropertySource is not an option. If you're working with a container that can't use @ServiceConnection then things are of limited use.

Chatting to @bsideup, he suggested the idea of a container factory that could create the container but also do other things.

@Bean
ContainerFactory<MyContainer> myContainer() {
    return ContainerFactory.of(MyContainer::new).withProperties(container -> return Map.of("some.property", container.getSomethingDynamic()));
}

Another option might be some kind of annotation to contribute things.