abendt
02/20/2025, 5:05 PMabendt
02/20/2025, 5:06 PMval container = install(ContainerExtension(GenericContainer("mycontainer:latest"))) {
withExposedPorts(8080)
}
...
container.getMappedPort(8080)
abendt
02/20/2025, 5:07 PMGenericContainer(DockerImageName.parse("mycontainer:latest"))
. Should the documentation be updated?
• Calling getMappedPort(8080)
fails with an exception. It seems the configuration block runs only after the container starts, so it has no effect. Calling withExposedPorts
directly on GenericContainer solves the issue. Am I missing something?
install(ContainerExtension(GenericContainer(DockerImageName.parse("mycontainer:latest")).withExposedPorts(8080)))