In Quarkus 2.1.0 the docker run command has changed to bind to the host network instead. This property, however, is invalid on windows (and mac?). Nor does this work properly if the container is started from another container (for example on our gitlab runner).
In Quarkus 2.1.0 the docker run command has changed to bind to the host network instead. This property, however, is invalid on windows (and mac?). Nor does this work properly if the container is started from another container (for example on our gitlab runner).
https://github.com/quarkusio/quarkus/blob/d0555c781c15cbc684684b3d79f98f2507658a94/test-framework/common/src/main/java/io/quarkus/test/common/DefaultDockerContainerLauncher.java#L81
Obviously the old behavior had major issues as well, so I thought of a solution that will work in all cases:
Why not run the docker image (containing the application) using testcontainers as well?
withNetwork(Network.SHARED)
, see the Kafka dev service)withNetworkAliases("name-" + Base58.randomString(5))
)DevServicesNativeConfigResultBuildItem
should contain both 'regular' as 'container-network' values, for example:kafka.bootstrap.servers
hasPLAINTEXT://localhost:49215
andPLAINTEXT://kafka-x42bz:9092,
quarkus.mongodb.connection-string
hasmongodb://localhost:49213/test
andmongodb://mongo-8ux2l:27017/test
When running the testcontainer containing the application, we would provide the second set of values while all others receive the first set.
https://github.com/quarkusio/quarkus/issues/18914
$upstream:18914$