docker -p 8003:5432 will expose container port 5432 on host port 8003.
This is extremely valuable when running parallel tests. It lets us avoid port conflicts.
I see no straightforward way to accomplish this with testcontainers.
Container.withExposedPorts(Integer... ports) takes a port array and maps each container port in the array, to the corresponding port on the host.
I expected to find a method with this signature something like this:
Container.withExposedPorts(Map<Integer,Integer> mappings)
Or maybe even:
Container.withExposedPortMappings(Integer... mappings)
…that would take the flattened mapping.
docker -p 8003:5432will expose container port 5432 on host port 8003.This is extremely valuable when running parallel tests. It lets us avoid port conflicts.
I see no straightforward way to accomplish this with testcontainers.
Container.withExposedPorts(Integer... ports)takes a port array and maps each container port in the array, to the corresponding port on the host.I expected to find a method with this signature something like this:
Container.withExposedPorts(Map<Integer,Integer> mappings)Or maybe even:
Container.withExposedPortMappings(Integer... mappings)…that would take the flattened mapping.