Skip to content

Commit aa8d557

Browse files
committed
Merge branch 'hotfix-1.1.3' into stable
2 parents ff22d94 + ecdd285 commit aa8d557

File tree

19 files changed

+93
-61
lines changed

19 files changed

+93
-61
lines changed

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/.twgit_features_subject
2-
/.twgit
1+
/.*
2+
!/.git*

CHANGELOG.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,23 @@
11
# Changelog
22

3+
## 1.1.3
4+
Merge pull request :
5+
- Use mdb over hdb #50
6+
- Ignore lost+found directories #53
7+
- Remove Volume command from Dockerfile #56
8+
9+
Update to light-baseimage:0.2.4
10+
11+
Release Note:
12+
In this version the new environment variable LDAP_BACKEND let you set the the backend used by your ldap database.
13+
By default it's hdb. In comming versions 1.2.x the default will be changed to mdb.
14+
15+
Environment variable LDAP_REPLICATION_HDB_SYNCPROV changed to LDAP_REPLICATION_DB_SYNCPROV
16+
317
## 1.1.2
418
Merge pull request :
519
- Honor LDAP_LOG_LEVEL on startup #39
6-
20+
721
Fix :
822
- slapd tcp bind is network not interface, and so does not respond on overlay networks #35
923
- specify base_dn without domain #37

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME = osixia/openldap
2-
VERSION = 1.1.2
2+
VERSION = 1.1.3
33

44
.PHONY: all build build-nocache test tag_latest release
55

README.md

Lines changed: 33 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,10 @@
22

33
[![Docker Pulls](https://img.shields.io/docker/pulls/osixia/openldap.svg)][hub]
44
[![Docker Stars](https://img.shields.io/docker/stars/osixia/openldap.svg)][hub]
5-
[![Image Size](https://img.shields.io/imagelayers/image-size/osixia/openldap/latest.svg)](https://imagelayers.io/?images=osixia/openldap:latest)
6-
[![Image Layers](https://img.shields.io/imagelayers/layers/osixia/openldap/latest.svg)](https://imagelayers.io/?images=osixia/openldap:latest)
75

86
[hub]: https://hub.docker.com/r/osixia/openldap/
97

10-
Latest release: 1.1.2 - OpenLDAP 2.4.40 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/openldap/) 
8+
Latest release: 1.1.3 - OpenLDAP 2.4.40 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/openldap/) 
119

1210
A docker image to run OpenLDAP.
1311

@@ -37,7 +35,7 @@ A docker image to run OpenLDAP.
3735
- [Link environment file](#link-environment-file)
3836
- [Make your own image or extend this image](#make-your-own-image-or-extend-this-image)
3937
- [Advanced User Guide](#advanced-user-guide)
40-
- [Extend osixia/openldap:1.1.2 image](#extend-osixiaopenldap112-image)
38+
- [Extend osixia/openldap:1.1.3 image](#extend-osixiaopenldap113-image)
4139
- [Make your own openldap image](#make-your-own-openldap-image)
4240
- [Tests](#tests)
4341
- [Kubernetes](#kubernetes)
@@ -55,7 +53,7 @@ If you find this image useful here's how you can help:
5553
## Quick Start
5654
Run OpenLDAP docker image:
5755

58-
docker run --name my-openldap-container --detach osixia/openldap:1.1.2
56+
docker run --name my-openldap-container --detach osixia/openldap:1.1.3
5957

6058
This start a new container with OpenLDAP running inside. Let's make the first search in our LDAP container:
6159

@@ -91,11 +89,12 @@ It will create an empty ldap for the company **Example Inc.** and the domain **e
9189
By default the admin has the password **admin**. All those default settings can be changed at the docker command line, for example:
9290

9391
docker run --env LDAP_ORGANISATION="My Company" --env LDAP_DOMAIN="my-company.com" \
94-
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.1.2
92+
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.1.3
9593

9694
#### Data persistence
9795

98-
The directories `/var/lib/ldap` (LDAP database files) and `/etc/ldap/slapd.d` (LDAP config files) has been declared as volumes, so your ldap files are saved outside the container in data volumes.
96+
The directories `/var/lib/ldap` (LDAP database files) and `/etc/ldap/slapd.d` (LDAP config files) are used to persist the schema and data information, and should be mapped as volumes, so your ldap files are saved outside the container (see [Use an existing ldap database](#use-an-existing-ldap-database)). However it can be useful to not use volumes,
97+
in case the image should be delivered complete with test data - this is especially useful when deriving other images from this one.
9998

10099
For more information about docker data volume, please refer to:
101100

@@ -115,11 +114,13 @@ simply mount this directories as a volume to `/var/lib/ldap` and `/etc/ldap/slap
115114

116115
docker run --volume /data/slapd/database:/var/lib/ldap \
117116
--volume /data/slapd/config:/etc/ldap/slapd.d
118-
--detach osixia/openldap:1.1.2
117+
--detach osixia/openldap:1.1.3
119118

120119
You can also use data volume containers. Please refer to:
121120
> [https://docs.docker.com/userguide/dockervolumes/](https://docs.docker.com/userguide/dockervolumes/)
122121
122+
Note: By default this image is waiting an **hdb** database backend, if you want to use any other database backend set backend type via the LDAP_BACKEND environement variable.
123+
123124
### Backup
124125
A simple solution to backup your ldap server, is our openldap-backup docker image:
125126
> [osixia/openldap-backup](https://github.com/osixia/docker-openldap-backup)
@@ -133,7 +134,7 @@ If you are looking for a simple solution to administrate your ldap server you ca
133134
#### Use auto-generated certificate
134135
By default TLS is enable, a certificate is created with the container hostname (it can be set by docker run --hostname option eg: ldap.example.org).
135136

136-
docker run --hostname ldap.my-company.com --detach osixia/openldap:1.1.2
137+
docker run --hostname ldap.my-company.com --detach osixia/openldap:1.1.3
137138

138139
#### Use your own certificate
139140

@@ -143,24 +144,24 @@ You can set your custom certificate at run time, by mounting a directory contain
143144
--env LDAP_TLS_CRT_FILENAME=my-ldap.crt \
144145
--env LDAP_TLS_KEY_FILENAME=my-ldap.key \
145146
--env LDAP_TLS_CA_CRT_FILENAME=the-ca.crt \
146-
--detach osixia/openldap:1.1.2
147+
--detach osixia/openldap:1.1.3
147148

148149
Other solutions are available please refer to the [Advanced User Guide](#advanced-user-guide)
149150

150151
#### Disable TLS
151152
Add --env LDAP_TLS=false to the run command:
152153

153-
docker run --env LDAP_TLS=false --detach osixia/openldap:1.1.2
154+
docker run --env LDAP_TLS=false --detach osixia/openldap:1.1.3
154155

155156
### Multi master replication
156157
Quick example, with the default config.
157158

158159
#Create the first ldap server, save the container id in LDAP_CID and get its IP:
159-
LDAP_CID=$(docker run --hostname ldap.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.1.2)
160+
LDAP_CID=$(docker run --hostname ldap.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.1.3)
160161
LDAP_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $LDAP_CID)
161162

162163
#Create the second ldap server, save the container id in LDAP2_CID and get its IP:
163-
LDAP2_CID=$(docker run --hostname ldap2.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.1.2)
164+
LDAP2_CID=$(docker run --hostname ldap2.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.1.3)
164165
LDAP2_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $LDAP2_CID)
165166

166167
#Add the pair "ip hostname" to /etc/hosts on each containers,
@@ -196,7 +197,7 @@ You may have some problems with mounted files on some systems. The startup scrip
196197

197198
To fix that run the container with `--copy-service` argument :
198199

199-
docker run [your options] osixia/openldap:1.1.2 --copy-service
200+
docker run [your options] osixia/openldap:1.1.3 --copy-service
200201

201202
### Debug
202203

@@ -205,11 +206,11 @@ Available levels are: `none`, `error`, `warning`, `info`, `debug` and `trace`.
205206

206207
Example command to run the container in `debug` mode:
207208

208-
docker run --detach osixia/openldap:1.1.2 --loglevel debug
209+
docker run --detach osixia/openldap:1.1.3 --loglevel debug
209210

210211
See all command line options:
211212

212-
docker run osixia/openldap:1.1.2 --help
213+
docker run osixia/openldap:1.1.3 --help
213214

214215

215216
## Environment Variables
@@ -241,6 +242,11 @@ Required and used for new ldap server only:
241242
- **LDAP_READONLY_USER_USERNAME** Read only user username. Defaults to `readonly`
242243
- **LDAP_READONLY_USER_PASSWORD** Read only user password. Defaults to `readonly`
243244

245+
Backend:
246+
- **LDAP_BACKEND**: Ldap backend. Defaults to `hdb` (In comming versions v1.2.x default will be mdb)
247+
248+
Help: http://www.openldap.org/doc/admin24/backends.html
249+
244250
TLS options:
245251
- **LDAP_TLS**: Add openldap TLS capabilities. Defaults to `true`
246252
- **LDAP_TLS_CRT_FILENAME**: Ldap ssl certificate filename. Defaults to `ldap.crt`
@@ -258,7 +264,7 @@ Replication options:
258264

259265
- **LDAP_REPLICATION_CONFIG_SYNCPROV**: olcSyncRepl options used for the config database. Without **rid** and **provider** which are automatically added based on LDAP_REPLICATION_HOSTS. Defaults to `binddn="cn=admin,cn=config" bindmethod=simple credentials=$LDAP_CONFIG_PASSWORD searchbase="cn=config" type=refreshAndPersist retry="60 +" timeout=1 starttls=critical`
260266

261-
- **LDAP_REPLICATION_HDB_SYNCPROV**: olcSyncRepl options used for the HDB database. Without **rid** and **provider** which are automatically added based on LDAP_REPLICATION_HOSTS. Defaults to `binddn="cn=admin,$LDAP_BASE_DN" bindmethod=simple credentials=$LDAP_ADMIN_PASSWORD searchbase="$LDAP_BASE_DN" type=refreshAndPersist interval=00:00:00:10 retry="60 +" timeout=1 starttls=critical`
267+
- **LDAP_REPLICATION_DB_SYNCPROV**: olcSyncRepl options used for the database. Without **rid** and **provider** which are automatically added based on LDAP_REPLICATION_HOSTS. Defaults to `binddn="cn=admin,$LDAP_BASE_DN" bindmethod=simple credentials=$LDAP_ADMIN_PASSWORD searchbase="$LDAP_BASE_DN" type=refreshAndPersist interval=00:00:00:10 retry="60 +" timeout=1 starttls=critical`
262268

263269
- **LDAP_REPLICATION_HOSTS**: list of replication hosts, must contain the current container hostname set by --hostname on docker run command. Defaults to :
264270
```yaml
@@ -268,7 +274,7 @@ Replication options:
268274

269275
If you want to set this variable at docker run command add the tag `#PYTHON2BASH:` and convert the yaml in python:
270276

271-
docker run --env LDAP_REPLICATION_HOSTS="#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']" --detach osixia/openldap:1.1.2
277+
docker run --env LDAP_REPLICATION_HOSTS="#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']" --detach osixia/openldap:1.1.3
272278

273279
To convert yaml to python online: http://yaml-online-parser.appspot.com/
274280

@@ -283,7 +289,7 @@ Other environment variables:
283289
Environment variables can be set by adding the --env argument in the command line, for example:
284290

285291
docker run --env LDAP_ORGANISATION="My company" --env LDAP_DOMAIN="my-company.com" \
286-
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.1.2
292+
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.1.3
287293

288294
Be aware that environment variable added in command line will be available at any time
289295
in the container. In this example if someone manage to open a terminal in this container
@@ -294,28 +300,28 @@ he will be able to read the admin password in clear text from environment variab
294300
For example if your environment files **my-env.yaml** and **my-env.yaml.startup** are in /data/ldap/environment
295301

296302
docker run --volume /data/ldap/environment:/container/environment/01-custom \
297-
--detach osixia/openldap:1.1.2
303+
--detach osixia/openldap:1.1.3
298304

299305
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).
300306

301307
Note: the container will try to delete the **\*.yaml.startup** 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 **\*.yaml.startup**:
302308

303309
docker run --volume /data/ldap/environment/my-env.yaml:/container/environment/01-custom/env.yaml \
304-
--detach osixia/openldap:1.1.2
310+
--detach osixia/openldap:1.1.3
305311

306312
#### Make your own image or extend this image
307313

308314
This is the best solution if you have a private registry. Please refer to the [Advanced User Guide](#advanced-user-guide) just below.
309315

310316
## Advanced User Guide
311317

312-
### Extend osixia/openldap:1.1.2 image
318+
### Extend osixia/openldap:1.1.3 image
313319

314320
If you need to add your custom TLS certificate, bootstrap config or environment files the easiest way is to extends this image.
315321

316322
Dockerfile example:
317323

318-
FROM osixia/openldap:1.1.2
324+
FROM osixia/openldap:1.1.3
319325
MAINTAINER Your Name <[email protected]>
320326

321327
ADD bootstrap /container/service/slapd/assets/config/bootstrap
@@ -324,6 +330,9 @@ Dockerfile example:
324330

325331
See complete example in **example/extend-osixia-openldap**
326332

333+
Warning: if you want to install new packages from debian repositories, this image has a configuration to prevent documentation and locales to be installed. If you need the doc and locales remove the following files :
334+
**/etc/dpkg/dpkg.cfg.d/01_nodoc** and **/etc/dpkg/dpkg.cfg.d/01_nolocales**
335+
327336
### Make your own openldap image
328337

329338
Clone this project:
@@ -334,7 +343,7 @@ Clone this project:
334343
Adapt Makefile, set your image NAME and VERSION, for example:
335344

336345
NAME = osixia/openldap
337-
VERSION = 1.1.2
346+
VERSION = 1.1.3
338347

339348
become:
340349
NAME = cool-guy/openldap

example/extend-osixia-openldap/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM osixia/openldap:1.1.2
1+
FROM osixia/openldap:1.1.3
22
MAINTAINER Your Name <[email protected]>
33

44
ADD bootstrap /container/service/slapd/assets/config/bootstrap

example/extend-osixia-openldap/environment/my-env.yaml.startup

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ LDAP_REPLICATION: false
3333
# are automaticaly replaced at run time
3434

3535
# if you want to add replication to an existing ldap
36-
# adapt LDAP_REPLICATION_CONFIG_SYNCPROV and LDAP_REPLICATION_HDB_SYNCPROV to your configuration
36+
# adapt LDAP_REPLICATION_CONFIG_SYNCPROV and LDAP_REPLICATION_DB_SYNCPROV to your configuration
3737
# avoid using $LDAP_BASE_DN, $LDAP_ADMIN_PASSWORD and $LDAP_CONFIG_PASSWORD variables
3838
LDAP_REPLICATION_CONFIG_SYNCPROV: binddn="cn=admin,cn=config" bindmethod=simple credentials=$LDAP_CONFIG_PASSWORD searchbase="cn=config" type=refreshAndPersist retry="60 +" timeout=1 starttls=critical
39-
LDAP_REPLICATION_HDB_SYNCPROV: binddn="cn=admin,$LDAP_BASE_DN" bindmethod=simple credentials=$LDAP_ADMIN_PASSWORD searchbase="$LDAP_BASE_DN" type=refreshAndPersist interval=00:00:00:10 retry="60 +" timeout=1 starttls=critical
39+
LDAP_REPLICATION_DB_SYNCPROV: binddn="cn=admin,$LDAP_BASE_DN" bindmethod=simple credentials=$LDAP_ADMIN_PASSWORD searchbase="$LDAP_BASE_DN" type=refreshAndPersist interval=00:00:00:10 retry="60 +" timeout=1 starttls=critical
4040
LDAP_REPLICATION_HOSTS:
4141
- ldap://ldap.example.org # The order must be the same on all ldap servers
4242
- ldap://ldap2.example.org

example/kubernetes/simple/ldap-rc.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
spec:
1616
containers:
1717
- name: ldap
18-
image: osixia/openldap:1.1.2
18+
image: osixia/openldap:1.1.3
1919
volumeMounts:
2020
- name: ldap-data
2121
mountPath: /var/lib/ldap
@@ -63,7 +63,7 @@ spec:
6363
value: "false"
6464
- name: LDAP_REPLICATION_CONFIG_SYNCPROV
6565
value: "binddn=\"cn=admin,cn=config\" bindmethod=simple credentials=$LDAP_CONFIG_PASSWORD searchbase=\"cn=config\" type=refreshAndPersist retry=\"60 +\" timeout=1 starttls=critical"
66-
- name: LDAP_REPLICATION_HDB_SYNCPROV
66+
- name: LDAP_REPLICATION_DB_SYNCPROV
6767
value: "binddn=\"cn=admin,$LDAP_BASE_DN\" bindmethod=simple credentials=$LDAP_ADMIN_PASSWORD searchbase=\"$LDAP_BASE_DN\" type=refreshAndPersist interval=00:00:00:10 retry=\"60 +\" timeout=1 starttls=critical"
6868
- name: LDAP_REPLICATION_HOSTS
6969
value: "#PYTHON2BASH:['ldap://ldap-one-service', 'ldap://ldap-two-service']"

example/kubernetes/using-secrets/environment/my-env.yaml.startup

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ LDAP_REPLICATION: false
3333
# are automaticaly replaced at run time
3434

3535
# if you want to add replication to an existing ldap
36-
# adapt LDAP_REPLICATION_CONFIG_SYNCPROV and LDAP_REPLICATION_HDB_SYNCPROV to your configuration
36+
# adapt LDAP_REPLICATION_CONFIG_SYNCPROV and LDAP_REPLICATION_DB_SYNCPROV to your configuration
3737
# avoid using $LDAP_BASE_DN, $LDAP_ADMIN_PASSWORD and $LDAP_CONFIG_PASSWORD variables
3838
LDAP_REPLICATION_CONFIG_SYNCPROV: binddn="cn=admin,cn=config" bindmethod=simple credentials=$LDAP_CONFIG_PASSWORD searchbase="cn=config" type=refreshAndPersist retry="60 +" timeout=1 starttls=critical
39-
LDAP_REPLICATION_HDB_SYNCPROV: binddn="cn=admin,$LDAP_BASE_DN" bindmethod=simple credentials=$LDAP_ADMIN_PASSWORD searchbase="$LDAP_BASE_DN" type=refreshAndPersist interval=00:00:00:10 retry="60 +" timeout=1 starttls=critical
39+
LDAP_REPLICATION_DB_SYNCPROV: binddn="cn=admin,$LDAP_BASE_DN" bindmethod=simple credentials=$LDAP_ADMIN_PASSWORD searchbase="$LDAP_BASE_DN" type=refreshAndPersist interval=00:00:00:10 retry="60 +" timeout=1 starttls=critical
4040
LDAP_REPLICATION_HOSTS:
4141
- ldap://ldap.example.org # The order must be the same on all ldap servers
4242
- ldap://ldap2.example.org

example/kubernetes/using-secrets/ldap-rc.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ spec:
1515
spec:
1616
containers:
1717
- name: ldap
18-
image: osixia/openldap:1.1.2
18+
image: osixia/openldap:1.1.3
1919
command:
2020
- --copy-service
2121
volumeMounts:

image/Dockerfile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Use osixia/light-baseimage
22
# sources: https://github.com/osixia/docker-light-baseimage
3-
FROM osixia/light-baseimage:0.2.2
3+
FROM osixia/light-baseimage:0.2.4
44
MAINTAINER Bertrand Gouny <[email protected]>
55

66
# Add openldap user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
@@ -28,8 +28,5 @@ RUN /container/tool/install-service
2828
# Add default env variables
2929
ADD environment /container/environment/99-default
3030

31-
# Set OpenLDAP data and config directories in a data volume
32-
VOLUME ["/var/lib/ldap", "/etc/ldap/slapd.d"]
33-
3431
# Expose default ldap and ldaps ports
3532
EXPOSE 389 636

0 commit comments

Comments
 (0)