Docker-openldap: Add to README.md insturctions for adding custom schema

Created on 15 Dec 2017  路  3Comments  路  Source: osixia/docker-openldap

I have mySchema.schema which has this definition

attributetype ( 2.16.840.1.113734.3.1.1
    NAME 'spid'
    DESC 'Service provider ID'
    EQUALITY caseIgnoreMatch
    SUBSTR caseIgnoreSubstringsMatch
    SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

so on container start

docker run --env LDAP_ADMIN_PASSWORD="mypass" --env LDAP_DOMAIN="example.com" --env LDAP_TLS=false --name=my-ldap --volume /Users/me/LDAP/data:/container/service/slapd/assets/config/bootstrap/ldif/custom osixia/openldap:1.1.10 --copy-service --loglevel debug

I get this error

ldap_add: Undefined attribute type (17)
    additional info: spid: attribute type undefined

my data folder _/Users/me/LDAP/data_ does have schema definition and yes, I have tried to mount it to different places. Could you please add more information about mounting schema file to container?

Thanks in advance,
Michael

docs enhancement

Most helpful comment

As written in image/service/slapd/startup.sh (follow $BOOTSTRAP variable), *.schema files from /container/service/slapd/assets/config/bootstrap/schema directory are loaded (after a schema-to-ldif.sh conversion) only if database and config directories are empty.

As I had to start a new ldap service, I have restarted the container from a fresh clean data/config volumes and thus my schema has been loaded.

All 3 comments

Hi Michael,
create a .schema file and put in then /container/service/slapd/assets/config/bootstrap/schema. The startup script will create the ldif for you and add to the server schema files.

This is my working schema file (spid.schema).

attributetype ( 2.25.1 NAME 'spidCode' DESC 'SPID - Spid Code' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} ) objectclass ( 2.25 NAME 'spidPerson' DESC '' SUP inetOrgPerson STRUCTURAL MUST ( spidCode ) )

Please reneame the file in my.schema because the _Schema_ name part is offending some startup script.

Regards Gianluca.

hello,
i have a .schema file named my.schema in docker host /mnt/ldap-docker/schema/

`
attributetype ( 2.16.840.1.113730.3.1.901
NAME 'userType'
DESC 'type of user'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

objectclass ( 2.16.840.1.113730.3.2.2
NAME 'inetOrgPerson'
DESC 'RFC2798: Internet Organizational Person'
SUP organizationalPerson
STRUCTURAL
MAY ( userType )
)
`

i run ldap with

docker run --env LDAP_ORGANISATION="myconpany" --env LDAP_DOMAIN="myconpany.com" \ --env LDAP_ADMIN_PASSWORD="admin321" \ -p 389:389 -p 636:636 \ --volume /mnt/ldap-docker/database:/var/lib/ldap \ --volume /mnt/ldap-docker/config:/etc/ldap/slapd.d \ --volume /mnt/ldap-docker/schema/my.schema:/container/service/slapd/assets/config/bootstrap/schema/my.schema \ --detach osixia/openldap:1.1.11 --copy-service

i still cannot add attribute userType for a user
Undefined attribute type (17) userType attribute type undefined

Is there anything wrong with me?

As written in image/service/slapd/startup.sh (follow $BOOTSTRAP variable), *.schema files from /container/service/slapd/assets/config/bootstrap/schema directory are loaded (after a schema-to-ldif.sh conversion) only if database and config directories are empty.

As I had to start a new ldap service, I have restarted the container from a fresh clean data/config volumes and thus my schema has been loaded.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

adambom picture adambom  路  6Comments

jckoester picture jckoester  路  4Comments

mgcrea picture mgcrea  路  3Comments

Ryonez picture Ryonez  路  4Comments

tlchan picture tlchan  路  3Comments