Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade to Testcontainers 1.15.1 and use prebuilt image for DB2 #858

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<jar.manifest>${project.basedir}/src/main/resources/META-INF/MANIFEST.MF</jar.manifest>
<!-- We skip sources jar generation as we do it with the assembly plugin to have greater control over the content -->
<source.skip>true</source.skip>
<testcontainers.version>1.12.4</testcontainers.version>
<testcontainers.version>1.15.1</testcontainers.version>
</properties>

<dependencyManagement>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import org.junit.rules.ExternalResource;
import org.testcontainers.containers.Db2Container;
import org.testcontainers.containers.wait.strategy.LogMessageWaitStrategy;
import org.testcontainers.utility.DockerImageName;

import io.vertx.core.net.JksOptions;
import io.vertx.db2client.DB2ConnectOptions;
Expand All @@ -35,6 +36,9 @@ public class DB2Resource extends ExternalResource {

private static final boolean CUSTOM_DB2 = get("DB2_HOST") != null;

private static final DockerImageName db2Image = DockerImageName.parse("aguibert/vertx-db2-ssl:1.0")
.asCompatibleSubstituteFor("ibmcom/db2");

/**
* In order for this container to be reused across test runs you need to add the line:
* <code>testcontainers.reuse.enable=true</code> to your <code>~/.testcontainers.properties</code>
Expand All @@ -45,15 +49,14 @@ public class DB2Resource extends ExternalResource {
private boolean started = false;
private boolean isDb2OnZ = false;
private DB2ConnectOptions options;
private final Db2Container instance = new Db2Container()

private final Db2Container instance = new Db2Container(db2Image)
.acceptLicense()
.withLogConsumer(out -> System.out.print("[DB2] " + out.getUtf8String()))
.withUsername("vertx")
.withPassword("vertx")
.withDatabaseName("vertx")
.withExposedPorts(50000, 50001)
.withFileSystemBind("src/test/resources/tls/server/", "/certs/")
.withFileSystemBind("src/test/resources/tls/db2_tls_setup.sh", "/var/custom/db2_tls_setup.sh")
.waitingFor(new LogMessageWaitStrategy()
.withRegEx(".*VERTX SSH SETUP DONE.*")
.withStartupTimeout(Duration.ofMinutes(10)))
Expand Down
5 changes: 5 additions & 0 deletions vertx-db2-client/src/test/resources/vertx-db2-ssl/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM ibmcom/db2:11.5.0.0a

COPY certs/ /certs/
COPY setup_scripts/ /var/custom/