Public | Automated Build

Last pushed: 2 years ago
Short Description
ApacheDS container providing an LDAP and optionally a Kerberos service.
Full Description

#Introduction

This Docker image provides an ApacheDS LDAP server. Optionally it could be used to provide a Kerberos server as well.

The project sources can be found on GitHub. The Docker image on Docker Hub.

#Build

git clone https://github.com/g17/ApacheDS.git
docker build -t h3nrik/apacheds .

#Installation

The folder /var/lib/apacheds-${APACHEDS_VERSION} contains the runtime data and thus has been defined as a volume. A volume container could be used for that. The image uses exactly the file system structure defined by the ApacheDS documentation.

The container can be started issuing the following command:

docker run --name ldap -d -p 389:10389 h3nrik/apacheds

#Usage

You can manage the ldap server with the admin user uid=admin,ou=system and the default password secret. The default instance comes with a pre-configured partition dc=example,dc=com.

An indivitual admin password should be set following this manual.

Then you can import entries into that partition via your own ldif file. A sample.ldif file is provided with the sources:

ldapadd -v -h <your-docker-ip>:389 -c -x -D uid=admin,ou=system -w <your-admin-password> -f `pwd`/sample/sample.ldif

#Customization

It is also possible to start up your own defined Apache DS instance with your own configuration for partitions and services. Therefore you need to mount your config.ldif file and set the APACHEDS_INSTANCE environment variable properly. In the provided sample configuration the instance is named default. Assuming your custom instance is called yourinstance the following command will do the trick:

docker run --name ldap -d -p 389:10389 -e APACHEDS_INSTANCE=yourinstance -v /path/to/your/config.ldif:/bootstrap/conf/config.ldif:ro h3nrik/apacheds

It would be possible to use this ApacheDS image to provide a Kerberos server as well. Just provide your own config.ldif file for that. Don't forget to expose the right port, then.

Also other services are possible. For further information read the configuration documentation.

Docker Pull Command
Owner
h3nrik
Source Repository

Comments (8)
swethavemuri
a year ago

docker run --name ldap -d -p 389:10389 -v /path/to/your/sample.ldif:/bootstrap/conf/config.ldif:ro h3nrik/apacheds

I am using the default apacheds instance.

When i try to run with a config.ldif (using the sample provided in your github repo) - I have the below error:

vm 1 | [21:02:03] ERROR [org.apache.directory.server.wrapper.ApacheDsTanukiWrapper] - Failed to start the service.
jvm 1 | org.apache.directory.api.ldap.model.exception.LdapNoSuchObjectException: ERR_216_ID_FOR_PARENT_NOT_FOUND Id for parent 'dc=com' not found!
jvm 1 | at org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition.add(AbstractBTreePartition.java:733)
jvm 1 | at org.apache.directory.server.core.partition.ldif.LdifPartition.add(LdifPartition.java:261)
jvm 1 | at org.apache.directory.server.config.ConfigPartitionInitializer.initConfigPartition(ConfigPartitionInitializer.java:181)
jvm 1 | at

zenocolo
a year ago

Same issue here, great container but somehow it survices restart not, is there no way to fix this (in an automated way?)

stixits
2 years ago

A work around that fixed the
"ldap_1 | wrapper | <-- Wrapper Stopped" for me:
deleting everything inside the /var/lib/apacheds-2.0.0-M20/default/cache directory

alexanderg
2 years ago

Hi,
running from docker-compose container is not starting 2nd time.

ldap_1 | wrapper | --> Wrapper Started as Console
ldap_1 | wrapper | Launching a JVM...
ldap_1 | jvm 1 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
ldap_1 | jvm 1 | Copyright 1999-2006 Tanuki Software, Inc. All Rights Reserved.
ldap_1 | jvm 1 |
ldap_1 | jvm 1 | [14:32:59] ERROR [org.apache.directory.server.wrapper.ApacheDsTanukiWrapper] - Failed to start the service.
ldap_1 | jvm 1 | org.apache.directory.api.ldap.model.exception.LdapOtherException: ERR_250_ENTRY_ALREADY_EXISTS dc=example,dc=com already exists!
ldap_1 | jvm 1 | at org.apache.directory.server.core.api.partition.AbstractPartition.initialize(AbstractPartition.java:94)
ldap_1 | jvm 1 | at org.apache.directory.server.core.DefaultDirectoryService.initialize(DefaultDirectoryService.java:1807)
ldap_1 | jvm 1 | at org.apache.directory.server.core.DefaultDirectoryService.startup(DefaultDirectoryService.java:1244)
ldap_1 | jvm 1 | at org.apache.directory.server.ApacheDsService.initDirectoryService(ApacheDsService.java:318)
ldap_1 | jvm 1 | at org.apache.directory.server.ApacheDsService.start(ApacheDsService.java:182)
ldap_1 | jvm 1 | at org.apache.directory.server.wrapper.ApacheDsTanukiWrapper.start(ApacheDsTanukiWrapper.java:72)
ldap_1 | jvm 1 | at org.tanukisoftware.wrapper.WrapperManager$12.run(WrapperManager.java:2788)
ldap_1 | jvm 1 | Caused by: org.apache.directory.api.ldap.model.exception.LdapOtherException: ERR_250_ENTRY_ALREADY_EXISTS dc=example,dc=com already exists!
ldap_1 | jvm 1 | at org.apache.directory.server.core.api.partition.AbstractPartition.initialize(AbstractPartition.java:94)
ldap_1 | jvm 1 | at org.apache.directory.server.core.shared.partition.DefaultPartitionNexus.addContextPartition(DefaultPartitionNexus.java:800)
ldap_1 | jvm 1 | at org.apache.directory.server.core.shared.partition.DefaultPartitionNexus.doInit(DefaultPartitionNexus.java:224)
ldap_1 | jvm 1 | at org.apache.directory.server.core.api.partition.AbstractPartition.initialize(AbstractPartition.java:89)
ldap_1 | jvm 1 | ... 6 more
ldap_1 | jvm 1 | Caused by: org.apache.directory.api.ldap.model.exception.LdapEntryAlreadyExistsException: ERR_250_ENTRY_ALREADY_EXISTS dc=example,dc=com already exists!
ldap_1 | jvm 1 | at org.apache.directory.server.core.partition.impl.btree.AbstractBTreePartition.add(AbstractBTreePartition.java:687)
ldap_1 | jvm 1 | at org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition.doInit(JdbmPartition.java:277)
ldap_1 | jvm 1 | at org.apache.directory.server.core.api.partition.AbstractPartition.initialize(AbstractPartition.java:89)
ldap_1 | jvm 1 | ... 9 more
ldap_1 | wrapper | <-- Wrapper Stopped

h3nrik
2 years ago

@ramonnb: For this image I use the folder structure of a standard ApacheDS installation. When the ApacheDS developers change their structure in future the one I use for this image will also change.

ramonnb
2 years ago

Hey would it be possible that the volume that is used may be a fixed folder so in future ApacheDS versions it does not change ?

h3nrik
2 years ago

@vacy: That is fixed, now. If you like you can give it another try :-)

vacy
2 years ago

Hi,
great work so far! :)
But one question about the restart procedure.
How do you do it?
The container is going to leave a pid file set for the apacheds, so on a new startup the apacheds daemon is going to tell me that there is already an instance running.

Nevertheless, I appreciate your work, thanks!
Cheers,
vacy
A docker and ldap newbie