|
12 | 12 | import org.elasticsearch.test.fixtures.testcontainers.DockerEnvironmentAwareTestContainer;
|
13 | 13 | import org.testcontainers.containers.wait.strategy.Wait;
|
14 | 14 | import org.testcontainers.containers.wait.strategy.WaitAllStrategy;
|
15 |
| -import org.testcontainers.images.builder.ImageFromDockerfile; |
| 15 | +import org.testcontainers.images.RemoteDockerImage; |
16 | 16 |
|
17 | 17 | import java.time.Duration;
|
18 | 18 |
|
19 | 19 | public final class SmbTestContainer extends DockerEnvironmentAwareTestContainer {
|
20 | 20 |
|
21 |
| - private static final String DOCKER_BASE_IMAGE = "ubuntu:24.04"; |
| 21 | + private static final String DOCKER_BASE_IMAGE = "docker.elastic.co/elasticsearch-dev/es-smb-fixture:1.0"; |
22 | 22 | public static final int AD_LDAP_PORT = 636;
|
23 | 23 | public static final int AD_LDAP_GC_PORT = 3269;
|
24 | 24 |
|
25 | 25 | public SmbTestContainer() {
|
26 |
| - super( |
27 |
| - new ImageFromDockerfile("es-smb-fixture").withDockerfileFromBuilder( |
28 |
| - builder -> builder.from(DOCKER_BASE_IMAGE) |
29 |
| - .env("TZ", "Etc/UTC") |
30 |
| - .run("DEBIAN_FRONTEND=noninteractive apt-get update -qqy && apt-get install -qqy tzdata winbind samba ldap-utils") |
31 |
| - .copy("fixture/provision/installsmb.sh", "/fixture/provision/installsmb.sh") |
32 |
| - .copy("fixture/certs/ca.key", "/fixture/certs/ca.key") |
33 |
| - .copy("fixture/certs/ca.pem", "/fixture/certs/ca.pem") |
34 |
| - .copy("fixture/certs/cert.pem", "/fixture/certs/cert.pem") |
35 |
| - .copy("fixture/certs/key.pem", "/fixture/certs/key.pem") |
36 |
| - .run("chmod +x /fixture/provision/installsmb.sh") |
37 |
| - .cmd("/fixture/provision/installsmb.sh && service samba-ad-dc restart && echo Samba started && sleep infinity") |
38 |
| - .build() |
39 |
| - ) |
40 |
| - .withFileFromClasspath("fixture/provision/installsmb.sh", "/smb/provision/installsmb.sh") |
41 |
| - .withFileFromClasspath("fixture/certs/ca.key", "/smb/certs/ca.key") |
42 |
| - .withFileFromClasspath("fixture/certs/ca.pem", "/smb/certs/ca.pem") |
43 |
| - .withFileFromClasspath("fixture/certs/cert.pem", "/smb/certs/cert.pem") |
44 |
| - .withFileFromClasspath("fixture/certs/key.pem", "/smb/certs/key.pem") |
45 |
| - ); |
| 26 | + super(new RemoteDockerImage(DOCKER_BASE_IMAGE)); |
46 | 27 |
|
47 | 28 | addExposedPort(AD_LDAP_PORT);
|
48 | 29 | addExposedPort(AD_LDAP_GC_PORT);
|
|
0 commit comments