diff --git a/extensions/devservices/db2/src/main/java/io/quarkus/devservices/db2/deployment/DB2DevServicesProcessor.java b/extensions/devservices/db2/src/main/java/io/quarkus/devservices/db2/deployment/DB2DevServicesProcessor.java index 19ec6c3b2ef8c..2cffec7a41db7 100644 --- a/extensions/devservices/db2/src/main/java/io/quarkus/devservices/db2/deployment/DB2DevServicesProcessor.java +++ b/extensions/devservices/db2/src/main/java/io/quarkus/devservices/db2/deployment/DB2DevServicesProcessor.java @@ -6,6 +6,7 @@ import java.util.Optional; import org.testcontainers.containers.Db2Container; +import org.testcontainers.utility.DockerImageName; import io.quarkus.datasource.common.runtime.DatabaseKind; import io.quarkus.datasource.deployment.spi.DevServicesDatasourceProvider; @@ -21,10 +22,11 @@ DevServicesDatasourceProviderBuildItem setupDB2() { public RunningDevServicesDatasource startDatabase(Optional username, Optional password, Optional datasourceName, Optional imageName, Map additionalProperties) { Db2Container container = new Db2Container( - imageName.orElse("ibmcom/db2:" + Db2Container.DEFAULT_TAG)) - .withPassword(password.orElse("quarkus")) - .withUsername(username.orElse("quarkus")) - .withDatabaseName(datasourceName.orElse("default")); + DockerImageName.parse(imageName.orElse("ibmcom/db2:" + Db2Container.DEFAULT_TAG)) + .asCompatibleSubstituteFor(DockerImageName.parse("ibmcom/db2"))) + .withPassword(password.orElse("quarkus")) + .withUsername(username.orElse("quarkus")) + .withDatabaseName(datasourceName.orElse("default")); additionalProperties.forEach(container::withUrlParam); container.start(); return new RunningDevServicesDatasource(container.getJdbcUrl(), container.getUsername(), diff --git a/extensions/devservices/mariadb/src/main/java/io/quarkus/devservices/postgresql/deployment/MariaDBDevServicesProcessor.java b/extensions/devservices/mariadb/src/main/java/io/quarkus/devservices/postgresql/deployment/MariaDBDevServicesProcessor.java index f3f9a9ea0ddda..d2c790e60d3ed 100644 --- a/extensions/devservices/mariadb/src/main/java/io/quarkus/devservices/postgresql/deployment/MariaDBDevServicesProcessor.java +++ b/extensions/devservices/mariadb/src/main/java/io/quarkus/devservices/postgresql/deployment/MariaDBDevServicesProcessor.java @@ -6,6 +6,7 @@ import java.util.Optional; import org.testcontainers.containers.MariaDBContainer; +import org.testcontainers.utility.DockerImageName; import io.quarkus.datasource.common.runtime.DatabaseKind; import io.quarkus.datasource.deployment.spi.DevServicesDatasourceProvider; @@ -21,10 +22,11 @@ DevServicesDatasourceProviderBuildItem setupMariaDB() { public RunningDevServicesDatasource startDatabase(Optional username, Optional password, Optional datasourceName, Optional imageName, Map additionalProperties) { MariaDBContainer container = new MariaDBContainer( - imageName.orElse(MariaDBContainer.IMAGE + ":" + MariaDBContainer.DEFAULT_TAG)) - .withPassword(password.orElse("quarkus")) - .withUsername(username.orElse("quarkus")) - .withDatabaseName(datasourceName.orElse("default")); + DockerImageName.parse(imageName.orElse(MariaDBContainer.IMAGE + ":" + MariaDBContainer.DEFAULT_TAG)) + .asCompatibleSubstituteFor(DockerImageName.parse(MariaDBContainer.IMAGE))) + .withPassword(password.orElse("quarkus")) + .withUsername(username.orElse("quarkus")) + .withDatabaseName(datasourceName.orElse("default")); additionalProperties.forEach(container::withUrlParam); container.start(); return new RunningDevServicesDatasource(container.getJdbcUrl(), container.getUsername(), diff --git a/extensions/devservices/mssql/src/main/java/io/quarkus/devservices/mssql/deployment/MSSQLDevServicesProcessor.java b/extensions/devservices/mssql/src/main/java/io/quarkus/devservices/mssql/deployment/MSSQLDevServicesProcessor.java index 6b2bddc178fee..6a9c6c35301b0 100644 --- a/extensions/devservices/mssql/src/main/java/io/quarkus/devservices/mssql/deployment/MSSQLDevServicesProcessor.java +++ b/extensions/devservices/mssql/src/main/java/io/quarkus/devservices/mssql/deployment/MSSQLDevServicesProcessor.java @@ -7,6 +7,7 @@ import org.testcontainers.containers.JdbcDatabaseContainer; import org.testcontainers.containers.MSSQLServerContainer; +import org.testcontainers.utility.DockerImageName; import io.quarkus.datasource.common.runtime.DatabaseKind; import io.quarkus.datasource.deployment.spi.DevServicesDatasourceProvider; @@ -22,8 +23,10 @@ DevServicesDatasourceProviderBuildItem setupMSSQL() { public RunningDevServicesDatasource startDatabase(Optional username, Optional password, Optional datasourceName, Optional imageName, Map additionalProperties) { JdbcDatabaseContainer container = new MSSQLServerContainer( - imageName.orElse(MSSQLServerContainer.IMAGE + ":" + MSSQLServerContainer.DEFAULT_TAG)) - .withPassword(password.orElse("Quarkuspassword1")); + DockerImageName + .parse(imageName.orElse(MSSQLServerContainer.IMAGE + ":" + MSSQLServerContainer.DEFAULT_TAG)) + .asCompatibleSubstituteFor(MSSQLServerContainer.IMAGE)) + .withPassword(password.orElse("Quarkuspassword1")); additionalProperties.forEach(container::withUrlParam); container.start(); return new RunningDevServicesDatasource(container.getJdbcUrl(), container.getUsername(), diff --git a/extensions/devservices/mysql/src/main/java/io/quarkus/devservices/postgresql/deployment/MySQLDevServicesProcessor.java b/extensions/devservices/mysql/src/main/java/io/quarkus/devservices/postgresql/deployment/MySQLDevServicesProcessor.java index 3058d55739610..905f3ada87f26 100644 --- a/extensions/devservices/mysql/src/main/java/io/quarkus/devservices/postgresql/deployment/MySQLDevServicesProcessor.java +++ b/extensions/devservices/mysql/src/main/java/io/quarkus/devservices/postgresql/deployment/MySQLDevServicesProcessor.java @@ -6,6 +6,7 @@ import java.util.Optional; import org.testcontainers.containers.MySQLContainer; +import org.testcontainers.utility.DockerImageName; import io.quarkus.datasource.common.runtime.DatabaseKind; import io.quarkus.datasource.deployment.spi.DevServicesDatasourceProvider; @@ -21,10 +22,11 @@ DevServicesDatasourceProviderBuildItem setupMysql() { public RunningDevServicesDatasource startDatabase(Optional username, Optional password, Optional datasourceName, Optional imageName, Map additionalProperties) { MySQLContainer container = new MySQLContainer( - imageName.orElse(MySQLContainer.IMAGE + ":" + MySQLContainer.DEFAULT_TAG)) - .withPassword(password.orElse("quarkus")) - .withUsername(username.orElse("quarkus")) - .withDatabaseName(datasourceName.orElse("default")); + DockerImageName.parse(imageName.orElse(MySQLContainer.IMAGE + ":" + MySQLContainer.DEFAULT_TAG)) + .asCompatibleSubstituteFor(DockerImageName.parse(MySQLContainer.IMAGE))) + .withPassword(password.orElse("quarkus")) + .withUsername(username.orElse("quarkus")) + .withDatabaseName(datasourceName.orElse("default")); additionalProperties.forEach(container::withUrlParam); container.start(); return new RunningDevServicesDatasource(container.getJdbcUrl(), container.getUsername(), diff --git a/extensions/devservices/postgresql/src/main/java/io/quarkus/devservices/postgresql/deployment/PostgresqlDevServicesProcessor.java b/extensions/devservices/postgresql/src/main/java/io/quarkus/devservices/postgresql/deployment/PostgresqlDevServicesProcessor.java index 310d41b558093..f28168ab46f2b 100644 --- a/extensions/devservices/postgresql/src/main/java/io/quarkus/devservices/postgresql/deployment/PostgresqlDevServicesProcessor.java +++ b/extensions/devservices/postgresql/src/main/java/io/quarkus/devservices/postgresql/deployment/PostgresqlDevServicesProcessor.java @@ -6,6 +6,7 @@ import java.util.Optional; import org.testcontainers.containers.PostgreSQLContainer; +import org.testcontainers.utility.DockerImageName; import io.quarkus.datasource.common.runtime.DatabaseKind; import io.quarkus.datasource.deployment.spi.DevServicesDatasourceProvider; @@ -14,6 +15,8 @@ public class PostgresqlDevServicesProcessor { + public static final String DEFAULT = PostgreSQLContainer.IMAGE + ":" + PostgreSQLContainer.DEFAULT_TAG; + @BuildStep DevServicesDatasourceProviderBuildItem setupPostgres() { return new DevServicesDatasourceProviderBuildItem(DatabaseKind.POSTGRESQL, new DevServicesDatasourceProvider() { @@ -21,10 +24,11 @@ DevServicesDatasourceProviderBuildItem setupPostgres() { public RunningDevServicesDatasource startDatabase(Optional username, Optional password, Optional datasourceName, Optional imageName, Map additionalProperties) { PostgreSQLContainer container = new PostgreSQLContainer( - imageName.orElse(PostgreSQLContainer.IMAGE + ":" + PostgreSQLContainer.DEFAULT_TAG)) - .withPassword(password.orElse("quarkus")) - .withUsername(username.orElse("quarkus")) - .withDatabaseName(datasourceName.orElse("default")); + DockerImageName.parse(imageName.orElse(DEFAULT)) + .asCompatibleSubstituteFor(DockerImageName.parse(PostgreSQLContainer.IMAGE))) + .withPassword(password.orElse("quarkus")) + .withUsername(username.orElse("quarkus")) + .withDatabaseName(datasourceName.orElse("default")); additionalProperties.forEach(container::withUrlParam); container.start(); return new RunningDevServicesDatasource(container.getJdbcUrl(), container.getUsername(),