Giter Site home page Giter Site logo

apacheds's Introduction

Apache DS in a Docker Container

Apache DS is a Java implementation of Directory server (LDAP). This projects puts it into container and makes it easier to configure and bootstrap it with some data.

Apache DS Page that explains what it is.

Docker registry entry for this container.

Running container

Simply run the container with docker:

docker run -d -p 10389:10389 greggigon/apacheds

This starts a default instance of Apache DS running on port 10389 with no SSL. It has a default admin user and password and all default Apache DS schemas.

user: uid=admin,ou=system password: secret

Configuration

Container has two volumes defined:

  • /data - if you want to persiste container data somewhere
  • /bootstrap - for configuration, schema and bootstraping file

Bootstraping

If you want to bootstrap Apache DS with a specific schema mount a bootstrap volume and place Apache DS specific schema in it.

docker run -d -p 10389:10389 -v /onmyhost:/bootstrap greggigon/apacheds

Sample schema can be found in a sample/schema.tar in this GitHub repository.

If you want to use specific config.ldif to setup Apache DS place it in the mounted volume for /bootstrap directory. Container will pick it up automaticaly.

If you have some extra data you want to put into Directory, you can place a file in the /bootstrap mounting folder and setup Environment variable BOOTSTRAP_FILE.

docker run -d -p 10389:10389 -v /onmyhost:/bootstrap -e BOOTSTRAP_FILE=/bootstrap/the-file.ldif greggigon/apacheds

Examples

sample folder containes example schema, example config file and example of a data creation in LDAP upon bootstrap.

Pull request for contributions are always WELCOME! :)

apacheds's People

Contributors

greggigon avatar jacobwalkr avatar joeferner avatar ossiemarks avatar z0rb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

apacheds's Issues

unable to connect to server after changing admin password

After changing the admin password according to the documentation the container is unable to start. Looks like /apacheds.sh hardcodes the password "secret"

Here's the logs:

ldap_1  | Starting ApacheDS - default...
ldap_1  | Waiting for LDAP to be available
ldap_1  | ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
ldap_1  | LDAP not up yet... retrying... (0/20)
ldap_1  | ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
ldap_1  | LDAP not up yet... retrying... (1/20)
ldap_1  | ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
ldap_1  | LDAP not up yet... retrying... (2/20)
ldap_1  | ldap_bind: Invalid credentials (49)
ldap_1  |       additional info: INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=admin,ou=system
ldap_1  | LDAP not up yet... retrying... (3/20)
ldap_1  | ldap_bind: Invalid credentials (49)
ldap_1  |       additional info: INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=admin,ou=system
ldap_1  | LDAP not up yet... retrying... (4/20)
ldap_1  | ldap_bind: Invalid credentials (49)
ldap_1  |       additional info: INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=admin,ou=system
ldap_1  | LDAP not up yet... retrying... (5/20)
ldap_1  | ldap_bind: Invalid credentials (49)
ldap_1  |       additional info: INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=admin,ou=system
ldap_1  | LDAP not up yet... retrying... (6/20)
ldap_1  | LDAP not up yet... retrying... (7/20)
ldap_1  | ldap_bind: Invalid credentials (49)
ldap_1  |       additional info: INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=admin,ou=system
ldap_1  | ldap_bind: Invalid credentials (49)
ldap_1  |       additional info: INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=admin,ou=system
ldap_1  | LDAP not up yet... retrying... (8/20)
ldap_1  | ldap_bind: Invalid credentials (49)
ldap_1  |       additional info: INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=admin,ou=system
ldap_1  | LDAP not up yet... retrying... (9/20)
ldap_1  | ldap_bind: Invalid credentials (49)
ldap_1  |       additional info: INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=admin,ou=system
ldap_1  | LDAP not up yet... retrying... (10/20)
ldap_1  | ldap_bind: Invalid credentials (49)
ldap_1  |       additional info: INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=admin,ou=system
ldap_1  | LDAP not up yet... retrying... (11/20)
ldap_1  | ldap_bind: Invalid credentials (49)
ldap_1  |       additional info: INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=admin,ou=system
ldap_1  | LDAP not up yet... retrying... (12/20)
ldap_1  | ldap_bind: Invalid credentials (49)
ldap_1  |       additional info: INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=admin,ou=system
ldap_1  | LDAP not up yet... retrying... (13/20)
ldap_1  | ldap_bind: Invalid credentials (49)
ldap_1  |       additional info: INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=admin,ou=system
ldap_1  | LDAP not up yet... retrying... (14/20)
ldap_1  | ldap_bind: Invalid credentials (49)
ldap_1  |       additional info: INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=admin,ou=system
ldap_1  | LDAP not up yet... retrying... (15/20)
ldap_1  | ldap_bind: Invalid credentials (49)
ldap_1  |       additional info: INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=admin,ou=system
ldap_1  | LDAP not up yet... retrying... (16/20)
ldap_1  | ldap_bind: Invalid credentials (49)
ldap_1  |       additional info: INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=admin,ou=system
ldap_1  | LDAP not up yet... retrying... (17/20)
ldap_1  | ldap_bind: Invalid credentials (49)
ldap_1  |       additional info: INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=admin,ou=system
ldap_1  | LDAP not up yet... retrying... (18/20)
ldap_1  | ldap_bind: Invalid credentials (49)
ldap_1  |       additional info: INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=admin,ou=system
ldap_1  | LDAP not up yet... retrying... (19/20)
ldap_1  | ldap_bind: Invalid credentials (49)
ldap_1  |       additional info: INVALID_CREDENTIALS: Bind failed: ERR_229 Cannot authenticate user uid=admin,ou=system
ldap_1  | LDAP not up yet... retrying... (20/20)
ldap_1  | TROUBLE!!! After [20] retries LDAP is still dead :(

Clarify the intent of BOOTSTRAP_FILE=/bootstrap/the-file.ldif and allow flags to be specified

If the typical use of BOOTSTRAP_FILE=/bootstrap/the-file.ldif is intended to be to populate (add) new data in ApacheDS then may be the ldapmodify should set the -a flag in the section.

if [ -n "${BOOTSTRAP_FILE}" ]; then
	echo "Bootstraping Apache DS with Data from ${BOOTSTRAP_FILE}"
	
	ldapmodify -h localhost -p 10389 -D 'uid=admin,ou=system' -w secret -a -f $BOOTSTRAP_FILE
fi

Alternatively use ldapadd.

As a workaround I cheated by setting BOOTSTRAP_FILE=/bootstrap/the-file.ldif -a

May be the user can set the additional flags using env var something like BOOTSTRAP_OPTS=-a ?

Path mismatch in shellscript

Dockerfile is now pulling the package version M24 this cause the folder name to become M24 as well. However, apacheds.sh is still trying to point to M20. Hence Apache DS never started.

Changing all insances of apacheds-2.0.0_M20 to apacheds-2.0.0_M24 would fix the problem.

can't re-start after stop

I'm running into an issue with this image where I can't restart a container after i stop it.

the first time I docker run --name apacheds greggigon/apacheds (with all my other config options), it starts up fine and works.

but when i docker stop apacheds and then later docker start apacheds again, the apacheds server never starts again.

i end up going through all 20 attempts to verify the service, in the docker logs apacheds output:

LDAP not up yet... retrying... (19/20)
ldap_sasl_bind(SIMPLE): Can't contact LDAP server (-1)
LDAP not up yet... retrying... (20/20)
TROUBLE!!! After [20] retries LDAP is still dead :(

any suggestions for making this work when i restart the container?

i'm not even sure where to look for errors, honestly... but i need this to allow stopping and restarting

thanks

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.