Skip to content

Commit e55a7ce

Browse files
committed
Merge branch 'release-1.1.10' into stable
2 parents 519e734 + 148da9d commit e55a7ce

File tree

10 files changed

+59
-29
lines changed

10 files changed

+59
-29
lines changed

CHANGELOG.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,13 @@
11
# Changelog
22

3+
## 1.1.10
4+
Fix:
5+
- Readme #145 #148
6+
- Let ldapmodify and ldapadd use the same auth #146
7+
- Enable matching uid's and gid's in the host and container. #156
8+
9+
Update to light-baseimage:1.1.1
10+
311
## 1.1.9
412
Add :
513
- LDAP_RFC2307BIS_SCHEMA option to use rfc2307bis schema instead of nis default schema

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.9
2+
VERSION = 1.1.10
33

44
.PHONY: build build-nocache test tag-latest push push-latest release git-tag-version
55

README.md

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,15 @@
44
![Docker Stars](https://img.shields.io/docker/stars/osixia/openldap.svg)
55
![](https://images.microbadger.com/badges/image/osixia/openldap.svg)
66

7-
Latest release: 1.1.9 - OpenLDAP 2.4.44 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/openldap/) 
7+
Latest release: 1.1.10 - OpenLDAP 2.4.44 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/openldap/) 
8+
9+
/!\ Security warning: Databases created with image version up to 1.1.10 creates two admin users with the same password, if you changed admin password after bootstrap you may be concerned by [issue #161](https://github.com/osixia/docker-openldap/issues/161).
810

911
**A docker image to run OpenLDAP.**
1012

1113
> OpenLDAP website : [www.openldap.org](http://www.openldap.org/)
1214
15+
1316
- [Contributing](#contributing)
1417
- [Quick Start](#quick-start)
1518
- [Beginner Guide](#beginner-guide)
@@ -34,7 +37,7 @@ Latest release: 1.1.9 - OpenLDAP 2.4.44 - [Changelog](CHANGELOG.md) | [Docker H
3437
- [Link environment file](#link-environment-file)
3538
- [Make your own image or extend this image](#make-your-own-image-or-extend-this-image)
3639
- [Advanced User Guide](#advanced-user-guide)
37-
- [Extend osixia/openldap:1.1.9 image](#extend-osixiaopenldap119-image)
40+
- [Extend osixia/openldap:1.1.10 image](#extend-osixiaopenldap1110-image)
3841
- [Make your own openldap image](#make-your-own-openldap-image)
3942
- [Tests](#tests)
4043
- [Kubernetes](#kubernetes)
@@ -52,7 +55,7 @@ If you find this image useful here's how you can help:
5255
## Quick Start
5356
Run OpenLDAP docker image:
5457

55-
docker run --name my-openldap-container --detach osixia/openldap:1.1.9
58+
docker run --name my-openldap-container --detach osixia/openldap:1.1.10
5659

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

@@ -88,13 +91,24 @@ It will create an empty ldap for the company **Example Inc.** and the domain **e
8891
By default the admin has the password **admin**. All those default settings can be changed at the docker command line, for example:
8992

9093
docker run --env LDAP_ORGANISATION="My Company" --env LDAP_DOMAIN="my-company.com" \
91-
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.1.9
94+
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.1.10
9295

9396
#### Data persistence
9497

9598
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,
9699
in case the image should be delivered complete with test data - this is especially useful when deriving other images from this one.
97100

101+
The default uid and gid used by the image may map to surprising
102+
counterparts in the host. If you need to match uid and gid in the
103+
container and in the host, you can use build parameters
104+
`LDAP_OPENLDAP_UID` and `LDAP_OPENLDAP_GID` to set uid and gid
105+
explicitly:
106+
107+
docker build --build-arg LDAP_OPENLDAP_GID=1234 --build-arg LDAP_OPENLDAP_UID=2345 -t my_ldap_image .
108+
docker run --name my_ldap_container -d my_ldap_image
109+
# this should output uid=2345(openldap) gid=1234(openldap) groups=1234(openldap)
110+
docker exec my_ldap_container id openldap
111+
98112
For more information about docker data volume, please refer to:
99113

100114
> [https://docs.docker.com/engine/tutorials/dockervolumes/](https://docs.docker.com/engine/tutorials/dockervolumes/)
@@ -122,12 +136,12 @@ argument to entrypoint if you don't want to overwrite them.
122136
# single file example:
123137
docker run \
124138
--volume ./bootstrap.ldif:/container/service/slapd/assets/config/bootstrap/ldif/50-bootstrap.ldif \
125-
osixia/openldap:1.1.9 --copy-service
139+
osixia/openldap:1.1.10 --copy-service
126140

127141
#directory example:
128142
docker run \
129143
--volume ./lidf:/container/service/slapd/assets/config/bootstrap/ldif/custom \
130-
osixia/openldap:1.1.9 --copy-service
144+
osixia/openldap:1.1.10 --copy-service
131145

132146
### Use an existing ldap database
133147

@@ -138,7 +152,7 @@ simply mount this directories as a volume to `/var/lib/ldap` and `/etc/ldap/slap
138152

139153
docker run --volume /data/slapd/database:/var/lib/ldap \
140154
--volume /data/slapd/config:/etc/ldap/slapd.d \
141-
--detach osixia/openldap:1.1.9
155+
--detach osixia/openldap:1.1.10
142156

143157
You can also use data volume containers. Please refer to:
144158
> [https://docs.docker.com/engine/tutorials/dockervolumes/](https://docs.docker.com/engine/tutorials/dockervolumes/)
@@ -158,7 +172,7 @@ If you are looking for a simple solution to administrate your ldap server you ca
158172
#### Use auto-generated certificate
159173
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).
160174

161-
docker run --hostname ldap.my-company.com --detach osixia/openldap:1.1.9
175+
docker run --hostname ldap.my-company.com --detach osixia/openldap:1.1.10
162176

163177
#### Use your own certificate
164178

@@ -168,24 +182,24 @@ You can set your custom certificate at run time, by mounting a directory contain
168182
--env LDAP_TLS_CRT_FILENAME=my-ldap.crt \
169183
--env LDAP_TLS_KEY_FILENAME=my-ldap.key \
170184
--env LDAP_TLS_CA_CRT_FILENAME=the-ca.crt \
171-
--detach osixia/openldap:1.1.9
185+
--detach osixia/openldap:1.1.10
172186

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

175189
#### Disable TLS
176190
Add --env LDAP_TLS=false to the run command:
177191

178-
docker run --env LDAP_TLS=false --detach osixia/openldap:1.1.9
192+
docker run --env LDAP_TLS=false --detach osixia/openldap:1.1.10
179193

180194
### Multi master replication
181195
Quick example, with the default config.
182196

183197
#Create the first ldap server, save the container id in LDAP_CID and get its IP:
184-
LDAP_CID=$(docker run --hostname ldap.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.1.9)
198+
LDAP_CID=$(docker run --hostname ldap.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.1.10)
185199
LDAP_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $LDAP_CID)
186200

187201
#Create the second ldap server, save the container id in LDAP2_CID and get its IP:
188-
LDAP2_CID=$(docker run --hostname ldap2.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.1.9)
202+
LDAP2_CID=$(docker run --hostname ldap2.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.1.10)
189203
LDAP2_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $LDAP2_CID)
190204

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

222236
To fix that run the container with `--copy-service` argument :
223237

224-
docker run [your options] osixia/openldap:1.1.9 --copy-service
238+
docker run [your options] osixia/openldap:1.1.10 --copy-service
225239

226240
### Debug
227241

@@ -230,11 +244,11 @@ Available levels are: `none`, `error`, `warning`, `info`, `debug` and `trace`.
230244

231245
Example command to run the container in `debug` mode:
232246

233-
docker run --detach osixia/openldap:1.1.9 --loglevel debug
247+
docker run --detach osixia/openldap:1.1.10 --loglevel debug
234248

235249
See all command line options:
236250

237-
docker run osixia/openldap:1.1.9 --help
251+
docker run osixia/openldap:1.1.10 --help
238252

239253

240254
## Environment Variables
@@ -299,7 +313,7 @@ Replication options:
299313

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

302-
docker run --env LDAP_REPLICATION_HOSTS="#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']" --detach osixia/openldap:1.1.9
316+
docker run --env LDAP_REPLICATION_HOSTS="#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']" --detach osixia/openldap:1.1.10
303317

304318
To convert yaml to python online: http://yaml-online-parser.appspot.com/
305319

@@ -319,7 +333,7 @@ Other environment variables:
319333
Environment variables can be set by adding the --env argument in the command line, for example:
320334

321335
docker run --env LDAP_ORGANISATION="My company" --env LDAP_DOMAIN="my-company.com" \
322-
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.1.9
336+
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.1.10
323337

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

332346
docker run --volume /data/ldap/environment:/container/environment/01-custom \
333-
--detach osixia/openldap:1.1.9
347+
--detach osixia/openldap:1.1.10
334348

335349
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).
336350

337351
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**:
338352

339353
docker run --volume /data/ldap/environment/my-env.yaml:/container/environment/01-custom/env.yaml \
340-
--detach osixia/openldap:1.1.9
354+
--detach osixia/openldap:1.1.10
341355

342356
#### Make your own image or extend this image
343357

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

346360
## Advanced User Guide
347361

348-
### Extend osixia/openldap:1.1.9 image
362+
### Extend osixia/openldap:1.1.10 image
349363

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

352366
Dockerfile example:
353367

354-
FROM osixia/openldap:1.1.9
368+
FROM osixia/openldap:1.1.10
355369
MAINTAINER Your Name <[email protected]>
356370

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

example/docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '2'
22
services:
33
openldap:
4-
image: osixia/openldap:1.1.9
4+
image: osixia/openldap:1.1.10
55
container_name: openldap
66
environment:
77
LDAP_LOG_LEVEL: "256"

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.9
1+
FROM osixia/openldap:1.1.10
22
MAINTAINER Your Name <[email protected]>
33

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

example/kubernetes/simple/ldap-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ spec:
1313
spec:
1414
containers:
1515
- name: ldap
16-
image: osixia/openldap:1.1.9
16+
image: osixia/openldap:1.1.10
1717
volumeMounts:
1818
- name: ldap-data
1919
mountPath: /var/lib/ldap

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ spec:
1313
spec:
1414
containers:
1515
- name: ldap
16-
image: osixia/openldap:1.1.9
16+
image: osixia/openldap:1.1.10
1717
args: ["--copy-service"]
1818
volumeMounts:
1919
- name: ldap-data

image/Dockerfile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,15 @@
11
# Use osixia/light-baseimage
22
# sources: https://github.com/osixia/docker-light-baseimage
3-
FROM osixia/light-baseimage:1.1.0
3+
FROM osixia/light-baseimage:1.1.1
44
MAINTAINER Bertrand Gouny <[email protected]>
55

6+
ARG LDAP_OPENLDAP_GID
7+
ARG LDAP_OPENLDAP_UID
8+
69
# Add openldap user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
7-
RUN groupadd -r openldap && useradd -r -g openldap openldap
10+
# If explicit uid or gid is given, use it.
11+
RUN if [ -z "${LDAP_OPENLDAP_GID}" ]; then groupadd -r openldap; else groupadd -r -g ${LDAP_OPENLDAP_GID} openldap; fi \
12+
&& if [ -z "${LDAP_OPENLDAP_UID}" ]; then useradd -r -g openldap openldap; else useradd -r -g openldap -u ${LDAP_OPENLDAP_UID} openldap; fi
813

914
# Install OpenLDAP, ldap-utils and ssl-tools from baseimage and clean apt-get files
1015
# sources: https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/add-service-available

image/service/slapd/assets/config/replication/replication-enable.ldif

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,3 +41,6 @@ add: olcSyncRepl
4141
-
4242
add: olcMirrorMode
4343
olcMirrorMode: TRUE
44+
-
45+
add: olcLimits
46+
olcLimits: dn.exact="cn=admin,$LDAP_BASE_DN" time.soft=unlimited time.hard=unlimited size.soft=unlimited size.hard=unlimited

image/service/slapd/startup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ if [ ! -e "$FIRST_START_DONE" ]; then
6969
if grep -iq changetype $LDIF_FILE ; then
7070
ldapmodify -Y EXTERNAL -Q -H ldapi:/// -f $LDIF_FILE 2>&1 | log-helper debug || ldapmodify -h localhost -p 389 -D cn=admin,$LDAP_BASE_DN -w $LDAP_ADMIN_PASSWORD -f $LDIF_FILE 2>&1 | log-helper debug
7171
else
72-
ldapadd -Y EXTERNAL -Q -H ldapi:/// -f $LDIF_FILE |& log-helper debug
72+
ldapadd -Y EXTERNAL -Q -H ldapi:/// -f $LDIF_FILE |& log-helper debug || ldapadd -h localhost -p 389 -D cn=admin,$LDAP_BASE_DN -w $LDAP_ADMIN_PASSWORD -f $LDIF_FILE 2>&1 | log-helper debug
7373
fi
7474
}
7575

0 commit comments

Comments
 (0)