Skip to content

Commit a3aa25d

Browse files
committed
Merge branch 'hotfix-1.1.1' into stable
2 parents d619bd5 + 3643e34 commit a3aa25d

File tree

11 files changed

+98
-69
lines changed

11 files changed

+98
-69
lines changed

CHANGELOG.md

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

3+
## 1.1.1
4+
Update to light-baseimage:0.2.2
5+
36
## 1.1.0
47
Update to light-baseimage:0.2.1 :
58
- Use \*.yaml.startup environment files to keep configuration secrets

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.0
2+
VERSION = 1.1.1
33

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

README.md

Lines changed: 35 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
# osixia/openldap
22

3-
[![](https://badge.imagelayers.io/osixia/openldap:latest.svg)](https://imagelayers.io/?images=osixia/openldap:latest 'Get your own badge on imagelayers.io') | Latest release: 1.1.0 - OpenLDAP 2.4.40 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/openldap/) 
3+
[![Docker Pulls](https://img.shields.io/docker/pulls/osixia/openldap.svg)][hub]
4+
[![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)
7+
8+
[hub]: https://hub.docker.com/r/osixia/openldap/
9+
10+
Latest release: 1.1.1 - OpenLDAP 2.4.40 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/openldap/) 
411

512
A docker image to run OpenLDAP.
613

@@ -20,6 +27,7 @@ A docker image to run OpenLDAP.
2027
- [Use your own certificate](#use-your-own-certificate)
2128
- [Disable TLS](#disable-tls)
2229
- [Multi master replication](#multi-master-replication)
30+
- [Fix docker mounted file problems](#fix-docker-mounted-file-problems)
2331
- [Debug](#debug)
2432
- [Environment Variables](#environment-variables)
2533
- [Default.yaml](#defaultyaml)
@@ -29,7 +37,7 @@ A docker image to run OpenLDAP.
2937
- [Link environment file](#link-environment-file)
3038
- [Make your own image or extend this image](#make-your-own-image-or-extend-this-image)
3139
- [Advanced User Guide](#advanced-user-guide)
32-
- [Extend osixia/openldap:1.1.0 image](#extend-osixiaopenldap110-image)
40+
- [Extend osixia/openldap:1.1.1 image](#extend-osixiaopenldap111-image)
3341
- [Make your own openldap image](#make-your-own-openldap-image)
3442
- [Tests](#tests)
3543
- [Kubernetes](#kubernetes)
@@ -47,7 +55,7 @@ If you find this image useful here's how you can help:
4755
## Quick Start
4856
Run OpenLDAP docker image:
4957

50-
docker run --name my-openldap-container --detach osixia/openldap:1.1.0
58+
docker run --name my-openldap-container --detach osixia/openldap:1.1.1
5159

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

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

8593
docker run --env LDAP_ORGANISATION="My Company" --env LDAP_DOMAIN="my-company.com" \
86-
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.1.0
94+
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.1.1
8795

8896
#### Data persistence
8997

@@ -107,7 +115,7 @@ simply mount this directories as a volume to `/var/lib/ldap` and `/etc/ldap/slap
107115

108116
docker run --volume /data/slapd/database:/var/lib/ldap \
109117
--volume /data/slapd/config:/etc/ldap/slapd.d
110-
--detach osixia/openldap:1.1.0
118+
--detach osixia/openldap:1.1.1
111119

112120
You can also use data volume containers. Please refer to:
113121
> [https://docs.docker.com/userguide/dockervolumes/](https://docs.docker.com/userguide/dockervolumes/)
@@ -125,7 +133,7 @@ If you are looking for a simple solution to administrate your ldap server you ca
125133
#### Use auto-generated certificate
126134
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).
127135

128-
docker run --hostname ldap.my-company.com --detach osixia/openldap:1.1.0
136+
docker run --hostname ldap.my-company.com --detach osixia/openldap:1.1.1
129137

130138
#### Use your own certificate
131139

@@ -135,24 +143,24 @@ You can set your custom certificate at run time, by mounting a directory contain
135143
--env LDAP_TLS_CRT_FILENAME=my-ldap.crt \
136144
--env LDAP_TLS_KEY_FILENAME=my-ldap.key \
137145
--env LDAP_TLS_CA_CRT_FILENAME=the-ca.crt \
138-
--detach osixia/openldap:1.1.0
146+
--detach osixia/openldap:1.1.1
139147

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

142150
#### Disable TLS
143151
Add --env LDAP_TLS=false to the run command:
144152

145-
docker run --env LDAP_TLS=false --detach osixia/openldap:1.1.0
153+
docker run --env LDAP_TLS=false --detach osixia/openldap:1.1.1
146154

147155
### Multi master replication
148156
Quick example, with the default config.
149157

150158
#Create the first ldap server, save the container id in LDAP_CID and get its IP:
151-
LDAP_CID=$(docker run --hostname ldap.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.1.0)
159+
LDAP_CID=$(docker run --hostname ldap.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.1.1)
152160
LDAP_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $LDAP_CID)
153161

154162
#Create the second ldap server, save the container id in LDAP2_CID and get its IP:
155-
LDAP2_CID=$(docker run --hostname ldap2.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.1.0)
163+
LDAP2_CID=$(docker run --hostname ldap2.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.1.1)
156164
LDAP2_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $LDAP2_CID)
157165

158166
#Add the pair "ip hostname" to /etc/hosts on each containers,
@@ -182,18 +190,26 @@ Search on the second ldap server, and billy should show up!
182190
objectClass: inetOrgPerson
183191
[...]
184192

193+
### Fix docker mounted file problems
194+
195+
You may have some problems with mounted files on some systems. The startup script try to make some file adjustment and fix files owner and permissions, this can result in multiple errors. See [Docker documentation](https://docs.docker.com/v1.4/userguide/dockervolumes/#mount-a-host-file-as-a-data-volume).
196+
197+
To fix that run the container with `--copy-service` argument :
198+
199+
docker run [your options] osixia/openldap:1.1.1 --copy-service
200+
185201
### Debug
186202

187203
The container default log level is **info**.
188204
Available levels are: `none`, `error`, `warning`, `info`, `debug` and `trace`.
189205

190206
Example command to run the container in `debug` mode:
191207

192-
docker run --detach osixia/openldap:1.1.0 --loglevel debug
208+
docker run --detach osixia/openldap:1.1.1 --loglevel debug
193209

194210
See all command line options:
195211

196-
docker run osixia/openldap:1.1.0 --help
212+
docker run osixia/openldap:1.1.1 --help
197213

198214

199215
## Environment Variables
@@ -251,7 +267,7 @@ Replication options:
251267

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

254-
docker run --env LDAP_REPLICATION_HOSTS="#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']" --detach osixia/openldap:1.1.0
270+
docker run --env LDAP_REPLICATION_HOSTS="#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']" --detach osixia/openldap:1.1.1
255271

256272
To convert yaml to python online: http://yaml-online-parser.appspot.com/
257273

@@ -266,7 +282,7 @@ Other environment variables:
266282
Environment variables can be set by adding the --env argument in the command line, for example:
267283

268284
docker run --env LDAP_ORGANISATION="My company" --env LDAP_DOMAIN="my-company.com" \
269-
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.1.0
285+
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.1.1
270286

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

279295
docker run --volume /data/ldap/environment:/container/environment/01-custom \
280-
--detach osixia/openldap:1.1.0
296+
--detach osixia/openldap:1.1.1
281297

282298
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).
283299

284300
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**:
285301

286302
docker run --volume /data/ldap/environment/my-env.yaml:/container/environment/01-custom/env.yaml \
287-
--detach osixia/openldap:1.1.0
303+
--detach osixia/openldap:1.1.1
288304

289305
#### Make your own image or extend this image
290306

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

293309
## Advanced User Guide
294310

295-
### Extend osixia/openldap:1.1.0 image
311+
### Extend osixia/openldap:1.1.1 image
296312

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

299315
Dockerfile example:
300316

301-
FROM osixia/openldap:1.1.0
317+
FROM osixia/openldap:1.1.1
302318
MAINTAINER Your Name <[email protected]>
303319

304320
ADD bootstrap /container/service/slapd/assets/config/bootstrap
@@ -317,7 +333,7 @@ Clone this project:
317333
Adapt Makefile, set your image NAME and VERSION, for example:
318334

319335
NAME = osixia/openldap
320-
VERSION = 1.1.0
336+
VERSION = 1.1.1
321337

322338
become:
323339
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.0
1+
FROM osixia/openldap:1.1.1
22
MAINTAINER Your Name <[email protected]>
33

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

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.0
18+
image: osixia/openldap:1.1.1
1919
volumeMounts:
2020
- name: ldap-data
2121
mountPath: /var/lib/ldap
@@ -70,7 +70,7 @@ spec:
7070
- name: LDAP_REMOVE_CONFIG_AFTER_SETUP
7171
value: "true"
7272
- name: ldap-backup
73-
image: osixia/openldap-backup:0.1.7
73+
image: osixia/openldap-backup:0.1.8
7474
volumeMounts:
7575
- name: ldap-data
7676
mountPath: /var/lib/ldap

example/kubernetes/using-secrets/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.0
18+
image: osixia/openldap:1.1.1
1919
command:
2020
- --copy-service
2121
volumeMounts:
@@ -33,7 +33,7 @@ spec:
3333
- containerPort: 389
3434
name: openldap
3535
- name: ldap-backup
36-
image: osixia/openldap-backup:0.1.7
36+
image: osixia/openldap-backup:0.1.8
3737
volumeMounts:
3838
- name: ldap-data
3939
mountPath: /var/lib/ldap

image/Dockerfile

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
# Use osixia/light-baseimage
22
# sources: https://github.com/osixia/docker-light-baseimage
3-
FROM osixia/light-baseimage:0.2.1
3+
FROM osixia/light-baseimage:0.2.2
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
77
RUN groupadd -r openldap && useradd -r -g openldap openldap
88

9-
# Install OpenLDAP, ldap-utils and cfssl from baseimage
9+
# Install OpenLDAP, ldap-utils and cfssl from baseimage and clean apt-get files
1010
# sources: https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/add-service-available
1111
#  https://github.com/osixia/docker-light-baseimage/blob/stable/image/service-available/:cfssl/download.sh
1212
RUN apt-get -y update \
1313
&& /container/tool/add-service-available :cfssl \
1414
&& LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes --no-install-recommends \
1515
ldap-utils \
1616
openssl \
17-
slapd
17+
slapd \
18+
&& apt-get clean \
19+
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
1820

1921
# Add service directory to /container/service
2022
ADD service /container/service
2123

22-
# Use baseimage install-service script and clean all
24+
# Use baseimage install-service script
2325
# https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/install-service
24-
RUN /container/tool/install-service \
25-
&& apt-get clean \
26-
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
26+
RUN /container/tool/install-service
2727

2828
# Add default env variables
2929
ADD environment /container/environment/99-default

image/service/slapd/assets/config/bootstrap/ldif/03-memberOf.ldif

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,15 @@ dn: cn=module{0},cn=config
33
changetype: modify
44
add: olcModuleLoad
55
olcModuleLoad: memberof
6+
7+
# Backend memberOf overlay
8+
dn: olcOverlay={0}memberof,olcDatabase={1}hdb,cn=config
9+
changetype: add
10+
objectClass: olcOverlayConfig
11+
objectClass: olcMemberOf
12+
olcOverlay: {0}memberof
13+
olcMemberOfDangling: ignore
14+
olcMemberOfRefInt: TRUE
15+
olcMemberOfGroupOC: groupOfUniqueNames
16+
olcMemberOfMemberAD: uniqueMember
17+
olcMemberOfMemberOfAD: memberOf
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# Load refint module
2+
dn: cn=module{0},cn=config
3+
changetype: modify
4+
add: olcModuleLoad
5+
olcModuleLoad: refint
6+
7+
# Backend refint overlay
8+
dn: olcOverlay={1}refint,olcDatabase={1}hdb,cn=config
9+
changetype: add
10+
objectClass: olcOverlayConfig
11+
objectClass: olcRefintConfig
12+
olcOverlay: {1}refint
13+
olcRefintAttribute: owner
14+
olcRefintAttribute: manager
15+
olcRefintAttribute: uniqueMember
16+
olcRefintAttribute: member
17+
olcRefintAttribute: memberOf

0 commit comments

Comments
 (0)