Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,7 @@ private void applyConfiguration(CreateContainerCmd createCommand) {
// First collect all the randomized host ports from our 'exposedPorts' field
for (final Integer tcpPort : exposedPorts) {
ExposedPort exposedPort = ExposedPort.tcp(tcpPort);
allPortBindings.put(exposedPort, new PortBinding(Ports.Binding.empty(), exposedPort));
allPortBindings.put(exposedPort, new PortBinding(Ports.Binding.bindPort(0), exposedPort));
}
// Next collect all the fixed host ports from our 'portBindings' field, overwriting any randomized ports so that
// we don't create two bindings for the same container port.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ public static String start(DockerClient client) {
.withHostConfig(
new HostConfig()
.withAutoRemove(true)
.withPortBindings(new PortBinding(Ports.Binding.empty(), ryukExposedPort))
.withPortBindings(new PortBinding(Ports.Binding.bindPort(0), ryukExposedPort))
)
.withExposedPorts(ryukExposedPort)
.withName("testcontainers-ryuk-" + DockerClientFactory.SESSION_ID)
Expand Down