You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -108,6 +104,31 @@ For more information about docker data volume, please refer to:
108
104
109
105
Do not edit slapd.conf it's not used. To modify your server configuration use ldap utils: **ldapmodify / ldapadd / ldapdelete**
110
106
107
+
#### Seed ldap database with ldif
108
+
109
+
This image can load ldif files at startup with either `ldapadd` or `ldapmodify`.
110
+
Mount `.ldif` in `/container/service/slapd/assets/config/bootstrap/ldif` directory if you want to overwrite image default boostrap ldif files or in `/container/service/slapd/assets/config/bootstrap/ldif/custom` (recommended) to extend image config.
111
+
112
+
Files containing `changeType:` attributes will be loaded with `ldapmodify`.
113
+
114
+
The startup script provide some substitution in bootstrap ldif files:
115
+
`{{LDAP_BASE_DN }}` and `{{ LDAP_BACKEND }}` values are supported. Other `{{ * }}`
116
+
substitution are left as is.
117
+
118
+
Since startup script modifies `ldif` files, you **must** add `--copy-service`
119
+
argument to entrypoint if you don't want to overwrite them.
@@ -137,7 +158,7 @@ If you are looking for a simple solution to administrate your ldap server you ca
137
158
#### Use auto-generated certificate
138
159
By default, TLS is already configured and enabled, certificate is created using container hostname (it can be set by docker run --hostname option eg: ldap.example.org).
139
160
140
-
docker run --hostname ldap.my-company.com --detach osixia/openldap:1.1.8
161
+
docker run --hostname ldap.my-company.com --detach osixia/openldap:1.1.9
141
162
142
163
#### Use your own certificate
143
164
@@ -147,24 +168,24 @@ You can set your custom certificate at run time, by mounting a directory contain
147
168
--env LDAP_TLS_CRT_FILENAME=my-ldap.crt \
148
169
--env LDAP_TLS_KEY_FILENAME=my-ldap.key \
149
170
--env LDAP_TLS_CA_CRT_FILENAME=the-ca.crt \
150
-
--detach osixia/openldap:1.1.8
171
+
--detach osixia/openldap:1.1.9
151
172
152
173
Other solutions are available please refer to the [Advanced User Guide](#advanced-user-guide)
153
174
154
175
#### Disable TLS
155
176
Add --env LDAP_TLS=false to the run command:
156
177
157
-
docker run --env LDAP_TLS=false --detach osixia/openldap:1.1.8
178
+
docker run --env LDAP_TLS=false --detach osixia/openldap:1.1.9
158
179
159
180
### Multi master replication
160
181
Quick example, with the default config.
161
182
162
183
#Create the first ldap server, save the container id in LDAP_CID and get its IP:
163
-
LDAP_CID=$(docker run --hostname ldap.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.1.8)
184
+
LDAP_CID=$(docker run --hostname ldap.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.1.9)
#Add the pair "ip hostname" to /etc/hosts on each containers,
@@ -200,7 +221,7 @@ You may have some problems with mounted files on some systems. The startup scrip
200
221
201
222
To fix that run the container with `--copy-service` argument :
202
223
203
-
docker run [your options] osixia/openldap:1.1.8 --copy-service
224
+
docker run [your options] osixia/openldap:1.1.9 --copy-service
204
225
205
226
### Debug
206
227
@@ -209,11 +230,11 @@ Available levels are: `none`, `error`, `warning`, `info`, `debug` and `trace`.
209
230
210
231
Example command to run the container in `debug` mode:
211
232
212
-
docker run --detach osixia/openldap:1.1.8 --loglevel debug
233
+
docker run --detach osixia/openldap:1.1.9 --loglevel debug
213
234
214
235
See all command line options:
215
236
216
-
docker run osixia/openldap:1.1.8 --help
237
+
docker run osixia/openldap:1.1.9 --help
217
238
218
239
219
240
## Environment Variables
@@ -245,6 +266,8 @@ Required and used for new ldap server only:
245
266
-**LDAP_READONLY_USER_USERNAME** Read only user username. Defaults to `readonly`
246
267
-**LDAP_READONLY_USER_PASSWORD** Read only user password. Defaults to `readonly`
247
268
269
+
-**LDAP_RFC2307BIS_SCHEMA** Use rfc2307bis schema instead of nis schema. Defaults to `false`
270
+
248
271
Backend:
249
272
-**LDAP_BACKEND**: Ldap backend. Defaults to `hdb` (In comming versions v1.2.x default will be mdb)
250
273
@@ -276,11 +299,15 @@ Replication options:
276
299
277
300
If you want to set this variable at docker run command add the tag `#PYTHON2BASH:` and convert the yaml in python:
278
301
279
-
docker run --env LDAP_REPLICATION_HOSTS="#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']" --detach osixia/openldap:1.1.8
302
+
docker run --env LDAP_REPLICATION_HOSTS="#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']" --detach osixia/openldap:1.1.9
280
303
281
304
To convert yaml to python online: http://yaml-online-parser.appspot.com/
282
305
283
306
Other environment variables:
307
+
-**KEEP_EXISTING_CONFIG**: Do not change the ldap config. Defaults to `false`
308
+
- if set to *true* with an existing database, config will remain unchanged. Image tls and replication config will not be run. The container can be started with LDAP_ADMIN_PASSWORD and LDAP_CONFIG_PASSWORD empty or filled with fake data.
309
+
- if set to *true* when bootstrapping a new database, bootstap ldif and schema will not be added and tls and replication config will not be run.
310
+
284
311
-**LDAP_REMOVE_CONFIG_AFTER_SETUP**: delete config folder after setup. Defaults to `true`
285
312
-**LDAP_SSL_HELPER_PREFIX**: ssl-helper environment variables prefix. Defaults to `ldap`, ssl-helper first search config from LDAP_SSL_HELPER_* variables, before SSL_HELPER_* variables.
286
313
@@ -291,7 +318,7 @@ Other environment variables:
291
318
Environment variables can be set by adding the --env argument in the command line, for example:
292
319
293
320
docker run --env LDAP_ORGANISATION="My company" --env LDAP_DOMAIN="my-company.com" \
Be aware that environment variable added in command line will be available at any time
297
324
in the container. In this example if someone manage to open a terminal in this container
@@ -302,28 +329,28 @@ he will be able to read the admin password in clear text from environment variab
302
329
For example if your environment files **my-env.yaml** and **my-env.startup.yaml** are in /data/ldap/environment
303
330
304
331
docker run --volume /data/ldap/environment:/container/environment/01-custom \
305
-
--detach osixia/openldap:1.1.8
332
+
--detach osixia/openldap:1.1.9
306
333
307
334
Take care to link your environment files folder to `/container/environment/XX-somedir` (with XX < 99 so they will be processed before default environment files) and not directly to `/container/environment` because this directory contains predefined baseimage environment files to fix container environment (INITRD, LANG, LANGUAGE and LC_CTYPE).
308
335
309
336
Note: the container will try to delete the **\*.startup.yaml** file after the end of startup files so the file will also be deleted on the docker host. To prevent that : use --volume /data/ldap/environment:/container/environment/01-custom**:ro** or set all variables in **\*.yaml** file and don't use **\*.startup.yaml**:
310
337
311
338
docker run --volume /data/ldap/environment/my-env.yaml:/container/environment/01-custom/env.yaml \
312
-
--detach osixia/openldap:1.1.8
339
+
--detach osixia/openldap:1.1.9
313
340
314
341
#### Make your own image or extend this image
315
342
316
343
This is the best solution if you have a private registry. Please refer to the [Advanced User Guide](#advanced-user-guide) just below.
317
344
318
345
## Advanced User Guide
319
346
320
-
### Extend osixia/openldap:1.1.8 image
347
+
### Extend osixia/openldap:1.1.9 image
321
348
322
349
If you need to add your custom TLS certificate, bootstrap config or environment files the easiest way is to extends this image.
0 commit comments