Add Docker Compose service connection support for OpenLDAP
See gh-39258
This commit is contained in:
@@ -40,6 +40,8 @@ public final class DockerImageNames {
|
||||
|
||||
private static final String KAFKA_VERSION = "7.4.0";
|
||||
|
||||
private static final String LDAP_VERSION = "1.5.0";
|
||||
|
||||
private static final String MARIADB_VERSION = "10.10";
|
||||
|
||||
private static final String MONGO_VERSION = "5.0.17";
|
||||
@@ -119,6 +121,14 @@ public final class DockerImageNames {
|
||||
return DockerImageName.parse("confluentinc/cp-kafka").withTag(KAFKA_VERSION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a {@link DockerImageName} suitable for running OpenLdap.
|
||||
* @return a docker image name for running OpenLdap
|
||||
*/
|
||||
public static DockerImageName ldap() {
|
||||
return DockerImageName.parse("osixia/openldap").withTag(LDAP_VERSION);
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a {@link DockerImageName} suitable for running MariaDB.
|
||||
* @return a docker image name for running MariaDB
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2012-2024 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package org.springframework.boot.testsupport.testcontainers;
|
||||
|
||||
import org.testcontainers.containers.GenericContainer;
|
||||
|
||||
/**
|
||||
* A {@link GenericContainer} for OpenLdap.
|
||||
*
|
||||
* @author Philipp Kessler
|
||||
*/
|
||||
public class LdapContainer extends GenericContainer<LdapContainer> {
|
||||
|
||||
private static final int DEFAULT_LDAP_PORT = 389;
|
||||
|
||||
public LdapContainer() {
|
||||
super(DockerImageNames.ldap());
|
||||
addExposedPorts(DEFAULT_LDAP_PORT);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user