diff --git a/test/fixtures/testcontainer-utils/src/main/java/org/elasticsearch/test/fixtures/testcontainers/DockerEnvironmentAwareTestContainer.java b/test/fixtures/testcontainer-utils/src/main/java/org/elasticsearch/test/fixtures/testcontainers/DockerEnvironmentAwareTestContainer.java index ce4d6fda861cd..be8d597c26010 100644 --- a/test/fixtures/testcontainer-utils/src/main/java/org/elasticsearch/test/fixtures/testcontainers/DockerEnvironmentAwareTestContainer.java +++ b/test/fixtures/testcontainer-utils/src/main/java/org/elasticsearch/test/fixtures/testcontainers/DockerEnvironmentAwareTestContainer.java @@ -16,7 +16,6 @@ import org.testcontainers.DockerClientFactory; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.output.Slf4jLogConsumer; -import org.testcontainers.images.builder.ImageFromDockerfile; import java.io.File; import java.io.IOException; @@ -27,6 +26,7 @@ import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.concurrent.Future; import java.util.stream.Collectors; public abstract class DockerEnvironmentAwareTestContainer extends GenericContainer @@ -56,8 +56,8 @@ private static boolean isDockerAvailable() { } } - public DockerEnvironmentAwareTestContainer(ImageFromDockerfile imageFromDockerfile) { - super(imageFromDockerfile); + public DockerEnvironmentAwareTestContainer(Future image) { + super(image); } @Override diff --git a/x-pack/test/idp-fixture/build.gradle b/x-pack/test/idp-fixture/build.gradle index aa0042a58ed49..b1243b9eb681b 100644 --- a/x-pack/test/idp-fixture/build.gradle +++ b/x-pack/test/idp-fixture/build.gradle @@ -17,7 +17,7 @@ tasks.register("deployIdpFixtureDockerImages", DockerBuildTask) { baseImages = ["openjdk:11.0.16-jre"] noCache = BuildParams.isCi tags = ["docker.elastic.co/elasticsearch-dev/idp-fixture:1.0"] - getPush().set(BuildParams.isCi) + push = BuildParams.isCI getPlatforms().addAll( Architecture.values().collect{ it.dockerPlatform } ) } @@ -27,7 +27,7 @@ tasks.register("deployOpenLdapFixtureDockerImages", DockerBuildTask) { baseImages = ["osixia/openldap:1.4.0"] noCache = BuildParams.isCi tags = ["docker.elastic.co/elasticsearch-dev/openldap-fixture:1.0"] - getPush().set(true) + push = BuildParams.isCI getPlatforms().addAll( Architecture.values().collect{ it.dockerPlatform } ) } diff --git a/x-pack/test/idp-fixture/src/main/java/org/elasticsearch/test/fixtures/idp/IdpTestContainer.java b/x-pack/test/idp-fixture/src/main/java/org/elasticsearch/test/fixtures/idp/IdpTestContainer.java index 91d44a203dfc0..d76ca5741d8b3 100644 --- a/x-pack/test/idp-fixture/src/main/java/org/elasticsearch/test/fixtures/idp/IdpTestContainer.java +++ b/x-pack/test/idp-fixture/src/main/java/org/elasticsearch/test/fixtures/idp/IdpTestContainer.java @@ -11,7 +11,7 @@ import org.junit.rules.TemporaryFolder; import org.testcontainers.containers.Network; import org.testcontainers.containers.wait.strategy.Wait; -import org.testcontainers.images.builder.ImageFromDockerfile; +import org.testcontainers.images.RemoteDockerImage; import java.io.IOException; import java.nio.file.Path; @@ -32,14 +32,7 @@ protected IdpTestContainer() { } public IdpTestContainer(Network network) { - super( - new ImageFromDockerfile("es-idp-testfixture").withDockerfileFromBuilder(builder -> builder.from(DOCKER_BASE_IMAGE).build()) - .withFileFromClasspath("idp/jetty-custom/ssl.mod", "/idp/jetty-custom/ssl.mod") - .withFileFromClasspath("idp/jetty-custom/keystore", "/idp/jetty-custom/keystore") - .withFileFromClasspath("idp/shib-jetty-base/", "/idp/shib-jetty-base/") - .withFileFromClasspath("idp/shibboleth-idp/", "/idp/shibboleth-idp/") - .withFileFromClasspath("idp/bin/", "/idp/bin/") - ); + super(new RemoteDockerImage(DOCKER_BASE_IMAGE)); withNetworkAliases("idp"); withNetwork(network); waitingFor(Wait.forListeningPorts(4443)); diff --git a/x-pack/test/idp-fixture/src/main/java/org/elasticsearch/test/fixtures/idp/OpenLdapTestContainer.java b/x-pack/test/idp-fixture/src/main/java/org/elasticsearch/test/fixtures/idp/OpenLdapTestContainer.java index ea6e1890fe80d..69d42e8b985a3 100644 --- a/x-pack/test/idp-fixture/src/main/java/org/elasticsearch/test/fixtures/idp/OpenLdapTestContainer.java +++ b/x-pack/test/idp-fixture/src/main/java/org/elasticsearch/test/fixtures/idp/OpenLdapTestContainer.java @@ -10,7 +10,7 @@ import org.elasticsearch.test.fixtures.testcontainers.DockerEnvironmentAwareTestContainer; import org.junit.rules.TemporaryFolder; import org.testcontainers.containers.Network; -import org.testcontainers.images.builder.ImageFromDockerfile; +import org.testcontainers.images.RemoteDockerImage; import java.io.IOException; import java.nio.file.Path; @@ -29,12 +29,7 @@ public OpenLdapTestContainer() { } public OpenLdapTestContainer(Network network) { - super( - new ImageFromDockerfile("es-openldap-testfixture").withDockerfileFromBuilder(builder -> builder.from(DOCKER_BASE_IMAGE).build()) - .withFileFromClasspath("openldap/certs", "/openldap/certs/") - .withFileFromClasspath("openldap/ldif/users.ldif", "/openldap/ldif/users.ldif") - .withFileFromClasspath("openldap/ldif/config.ldif", "/openldap/ldif/config.ldif") - ); + super(new RemoteDockerImage(DOCKER_BASE_IMAGE)); withNetworkAliases("openldap"); withNetwork(network); withExposedPorts(389, 636);