Fix PostgresqlDatabaseContainerProvider get Image is incorrect (#15434)

This commit is contained in:
Wenjun Ruan 2024-01-19 10:29:46 +08:00 committed by GitHub
parent 0dc373df2a
commit dcf69cad20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 7 additions and 6 deletions

View File

@ -40,12 +40,13 @@ public class PostgresqlDatabaseContainerProvider implements DatabaseContainerPro
@Override
public GenericContainer<?> getContainer(DolphinSchedulerDatabaseContainer dataSourceContainer) {
// todo: test with multiple pg version
GenericContainer<?> postgresqlContainer = new PostgreSQLContainer(DockerImageName.parse("postgres:11.1"))
.withUsername("root")
.withPassword("root")
.withDatabaseName("dolphinscheduler")
.withNetwork(NETWORK)
.withExposedPorts(5432);
GenericContainer<?> postgresqlContainer =
new PostgreSQLContainer(DockerImageName.parse(dataSourceContainer.imageName()))
.withUsername("root")
.withPassword("root")
.withDatabaseName("dolphinscheduler")
.withNetwork(NETWORK)
.withExposedPorts(5432);
postgresqlContainer.setPortBindings(Lists.newArrayList("5432:5432"));
return postgresqlContainer;