Can't run image
Closed this issue · 9 comments
Hi,
I'm trying to use this image but I'm unable to start it. here is the listing:
$docker run --name ldap -d -p 389:10389 -v .../people.ldif:/bootstrap/conf/config.ldif:ro openmicroscopy/apacheds
92040fe8e5c10537f1924f0ec429f727bfe2750920a176f271a96fd93452e522
$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
$docker logs ldap --details --follow
'/bootstrap/cache' -> '/var/lib/apacheds/default/cache'
'/bootstrap/conf' -> '/var/lib/apacheds/default/conf'
'/bootstrap/conf/ads-contextentry.decoded' -> '/var/lib/apacheds/default/conf/ads-contextentry.decoded'
'/bootstrap/conf/config.ldif' -> '/var/lib/apacheds/default/conf/config.ldif'
'/bootstrap/conf/log4j.properties' -> '/var/lib/apacheds/default/conf/log4j.properties'
'/bootstrap/conf/wrapper-instance.conf' -> '/var/lib/apacheds/default/conf/wrapper-instance.conf'
'/bootstrap/log' -> '/var/lib/apacheds/default/log'
'/bootstrap/ome.ldif' -> '/var/lib/apacheds/default/ome.ldif'
'/bootstrap/partitions' -> '/var/lib/apacheds/default/partitions'
'/bootstrap/run' -> '/var/lib/apacheds/default/run'
changed ownership of '/var/lib/apacheds/default/run' from root:root to apacheds:apacheds
changed ownership of '/var/lib/apacheds/default/cache' from root:root to apacheds:apacheds
changed ownership of '/var/lib/apacheds/default/log' from root:root to apacheds:apacheds
changed ownership of '/var/lib/apacheds/default/partitions' from root:root to apacheds:apacheds
changed ownership of '/var/lib/apacheds/default/ome.ldif' from root:root to apacheds:apacheds
changed ownership of '/var/lib/apacheds/default/conf/wrapper-instance.conf' from root:root to apacheds:apacheds
changed ownership of '/var/lib/apacheds/default/conf/log4j.properties' from root:root to apacheds:apacheds
changed ownership of '/var/lib/apacheds/default/conf/config.ldif' from root:root to apacheds:apacheds
changed ownership of '/var/lib/apacheds/default/conf/ads-contextentry.decoded' from root:root to apacheds:apacheds
changed ownership of '/var/lib/apacheds/default/conf' from root:root to apacheds:apacheds
changed ownership of '/var/lib/apacheds/default' from root:root to apacheds:apacheds
Starting ApacheDS - default...
I've paste above the log file but, as shown, there is no any error. however, the container exists after one second. Did I miss any parameter ? I didn't set the instance name as I don't think I'd need it but, anyway, even if I do it, the result is the same.
Any idea ?
Many thanks in advance.
@nicolasduminil a priori this indicates either an issue with your LDIF configuration or with the mounting.
To be able to distinguish, could you try the same command using the original LDIF file provided in the base image i.e.
$ wget https://raw.githubusercontent.com/ome/apacheds-docker/master/instance/config.ldif && mv config.ldif /tmp/config.ldif
$ docker run --name ldap -d -p 389:10389 --rm -v /tmp/config.ldif:/bootstrap/conf/config.ldif:ro openmicroscopy/apacheds
```
and see if that command initializes a running container?
If it does, it is possible you might need to specify your apacheDS instance by setting the `APACHEDS_INSTANCE` environment variable as defined in https://github.com/ome/apacheds-docker#customization?
@sbesson : Many thanks for your suggestion. Yes, using the original LDIF works as expected, showing that the issue was with my LDIF file.
Kind regards,
Nicolas
@sbesson : Trying to find the issue in my ldif file but unsuccessfuly. Even a simple test file as follows:
# Organization for Example Corporation
dn: dc=example,dc=com
objectClass: dcObject
objectClass: organization
dc: example
o: Example Corporation
description: The Example Corporation
# Organizational Role for Directory Manager
dn: cn=Manager,dc=example,dc=com
objectClass: organizationalRole
cn: Manager
description: Directory Manager
won't work. Any suggestion please ?
By the way, starting the image with the ome.ldif file, provided in this repository, doesn't work neither. The only way that I managed to get it starting was with the default ldif file, either by not mounting any file, or mounting the default config.ldif file. As for the server instance, my understanding is that the parameter is optional and, if present, it might be any arbitrary chosen name, right ?
Thanks for pasting a complete example of your ldif file. Since you are using a different root dc than the default one used in this repository (openmicroscopy.org
), you will need to also modify the instance configuration files instance/config.ldif
and instance/ads-contextentry.decoded
accordingly as mentioned here.
Many thanks again for your update but I'm not sure how and when to do that. I can't start the image since its root dc isn't in phase with mine and I can't modify the root dc as long as the image isn't started. Could you please update the documentation and to provide the command required to start the image and to subsequently customize the root dc ? Alternatively, if this image doesn't support such an option, please state it clearly. In any case, starting the image with the default configuration and using sed commands in order to modify the root dc and then manually import the new LDIF file, is not an option in a containerized environment.
In any case, starting the image with the default configuration and using sed commands in order to modify the root dc and then manually import the new LDIF file, is not an option in a containerized environment.
I think there is some confusion as there are two suggested paths to customize the default configuration:
- the Custom Root DC section suggests a list of minimal steps to modify the configuration files to use a different root. As mentioned in the README, this requires the image to be rebuilt with these modifications before starting a container. This workflow is not meant to be executed in a running instance of the
openmicroscopy:apacheds
image as the server will be initialized with the default root dc. - the first paragraph of the Customization section includes the generic command to use the existing image with a custom server LDIF file and
APACHEDS_INSTANCE
. In this case, the LDIF file must specify a complete configuration of the ApacheDS server as documented in https://directory.apache.org/apacheds/advanced-ug/2.1-config-description.html. My suspicion is that the minimal file described in #29 (comment) lacks some of the parameters required to initialize the server. Following the recommendations of the ApacheDS documentation, have you tried to use Apache DirectoryStudio to create a working configuration and export it as a LDIF file that can be used in this workflow?
Could you please update the documentation and to provide the command required to start the image and to subsequently customize the root dc ? Alternatively, if this image doesn't support such an option, please state it clearly.
Thanks for the feedback. This image is primarily for internal purposes and aims to provide a default set-up allowing to test our wn software with an LDAP server. Many assumptions like the root dc are made on purpose and the goal is not to support an official extensible Docker image for Apache Directory at this point although we are giving pointers to customize the configuration or use the repository as a starting point.
Happy to try and add a sentence at the beginning of the README to capture the scope of this repository if that's useful
Hi, given your explanations above, my understanding is that the root dc customization is better done by extending and rebuilding the image, right ? Sorry for the confusion, I thought that I could just start the image with a mount point that contains the new root dc config file.
Another way would be, as far as I understood, to start the image with the default configuration and to launch a script creating a new instance and customizing the configuration files. Not sure how to create a new instance of a running Apache DS directory service but I'll dig a little as the point is beyond the scope of this image.
And yes, I tried to import my LDIF file, posted above, via the Apache Directory Studio and, of course, it fails saying that the root dc is not the expected one. But now things are clear, many thanks for your help and support.