File tree 1 file changed +2
-1
lines changed
modules/r2dbc/src/main/java/org/testcontainers/r2dbc
1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change 5
5
import io .r2dbc .spi .ConnectionFactoryMetadata ;
6
6
import io .r2dbc .spi .ConnectionFactoryOptions ;
7
7
import io .r2dbc .spi .Option ;
8
+ import org .testcontainers .DockerClientFactory ;
8
9
9
10
import javax .annotation .Nullable ;
10
11
@@ -21,7 +22,7 @@ public interface R2DBCDatabaseContainerProvider {
21
22
default ConnectionFactoryMetadata getMetadata (ConnectionFactoryOptions options ) {
22
23
ConnectionFactoryOptions .Builder builder = options .mutate ();
23
24
if (!options .hasOption (ConnectionFactoryOptions .HOST )) {
24
- builder .option (ConnectionFactoryOptions .HOST , "localhost" );
25
+ builder .option (ConnectionFactoryOptions .HOST , DockerClientFactory . instance (). dockerHostIpAddress () );
25
26
}
26
27
if (!options .hasOption (ConnectionFactoryOptions .PORT )) {
27
28
builder .option (ConnectionFactoryOptions .PORT , 65535 );
You can’t perform that action at this time.
0 commit comments