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
Copy file name to clipboardExpand all lines: README.md
+33-36Lines changed: 33 additions & 36 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,17 +1,19 @@
1
1
# osixia/openldap
2
2
3
+
[](https://imagelayers.io/?images=osixia/openldap:latest'Get your own badge on imagelayers.io')
4
+
3
5
A docker image to run OpenLDAP.
4
6
> [www.openldap.org](http://www.openldap.org/)
5
7
6
8
Fork of Nick Stenning docker-slapd :
7
9
https://github.com/nickstenning/docker-slapd
8
10
9
-
Add support of TLS and multi master replication.
11
+
Add support of TLS, multi master replication and easy bootstrap.
10
12
11
13
## Quick start
12
14
Run OpenLDAP docker image :
13
15
14
-
docker run -h ldap.example.org -d osixia/openldap
16
+
docker run -d osixia/openldap
15
17
16
18
This start a new container with a OpenLDAP server running inside.
17
19
The odd string printed by this command is the `CONTAINER_ID`.
@@ -25,7 +27,7 @@ make sure to replace `CONTAINER_ID` by your container id :
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.
65
67
66
-
Be careful, if you remove the container, data volumes will me removed too, except if you have linked this data volume to an other container.
67
-
68
68
For more information about docker data volume, please refer to :
@@ -77,7 +77,7 @@ Assuming you have a LDAP database on your docker host in the directory `/data/sl
77
77
and the corresponding LDAP config files on your docker host in the directory `/data/slapd/config`
78
78
simply mount this directories as a volume to `/var/lib/ldap` and `/etc/ldap/slapd.d`:
79
79
80
-
docker run -h ldap.example.org -v /data/slapd/database:/var/lib/ldap \
80
+
docker run -v /data/slapd/database:/var/lib/ldap \
81
81
-v /data/slapd/config:/etc/ldap/slapd.d
82
82
-d osixia/openldap
83
83
@@ -87,17 +87,17 @@ You can also use data volume containers. Please refer to :
87
87
### Using TLS
88
88
89
89
#### Use autogenerated certificate
90
-
By default TLS is enable, a certificate is created with the container hostname (set by -h option eg: ldap.example.org).
90
+
By default TLS is enable, a certificate is created with the container hostname (it can be set by docker run -h option eg: ldap.example.org).
91
91
92
-
docker run -h ldap.example.org -e SERVER_NAME=ldap.my-compagny.com -d osixia/openldap
92
+
docker run -h ldap.my-compagny.com -d osixia/openldap
93
93
94
94
#### Use your own certificate
95
95
96
-
Add your custom certificate, private key and CA certificate in the directory **image/service/slapd/assets/ssl** adjust filename in **image/env.yml** and rebuild the image ([see manual build](#manual-build)).
96
+
Add your custom certificate, private key and CA certificate in the directory **image/service/slapd/assets/ssl** adjust filename in **image/env.yaml** and rebuild the image ([see manual build](#manual-build)).
97
97
98
-
Or you can set your custom certificate at run time, by mouting a directory containing thoses files to **/osixia/slapd/assets/ssl** and adjust there name with the following environment variables :
98
+
Or you can set your custom certificate at run time, by mouting a directory containing thoses files to **/container/service/slapd/assets/ssl** and adjust there name with the following environment variables :
99
99
100
-
docker run -h ldap.example.org -v /path/to/certifates:/osixia/slapd/assets/ssl \
100
+
docker run -h ldap.example.org -v /path/to/certifates:/container/service/slapd/assets/ssl \
101
101
-e SSL_CRT_FILENAME=my-ldap.crt \
102
102
-e SSL_KEY_FILENAME=my-ldap.key \
103
103
-e SSL_CA_CRT_FILENAME=the-ca.crt \
@@ -106,37 +106,30 @@ Or you can set your custom certificate at run time, by mouting a directory conta
106
106
#### Disable TLS
107
107
Add -e USE_TLS=false to the run command :
108
108
109
-
docker run -h ldap.example.org -e USE_TLS=false -d osixia/openldap
109
+
docker run -e USE_TLS=false -d osixia/openldap
110
110
111
111
### Multi master replication
112
112
Quick example, with the default config.
113
113
114
-
Create the first ldap server, save the container id in LDAP_CID and get its IP:
115
-
114
+
#Create the first ldap server, save the container id in LDAP_CID and get its IP:
116
115
LDAP_CID=$(docker run -h ldap.example.org -e USE_REPLICATION=true -d osixia/openldap)
Environement variables defaults are set in **image/env.yml**. You can modify environment variable values directly in this file and rebuild the image ([see manual build](#manual-build)). You can also override those values at run time with -e argument or by setting your own env.yml file as a docker volume to `/etc/env.yml`. See examples below.
160
+
Environement variables defaults are set in **image/env.yaml**. You can modify environment variable values directly in this file and rebuild the image ([see manual build](#manual-build)). You can also override those values at run time with -e argument or by setting your own env.yaml file as a docker volume to `/etc/env.yaml`. See examples below.
165
161
166
162
General container configuration :
167
-
-**LDAP_LOG_LEVEL**: Slap log level. defaults to `-1`. See table 5.1 in http://www.openldap.org/doc/admin24/slapdconf2.html for the available log levels.
163
+
-**LDAP_LOG_LEVEL**: Slap log level. defaults to `256`. See table 5.1 in http://www.openldap.org/doc/admin24/slapdconf2.html for the available log levels.
168
164
169
165
Required and used for new ldap server only :
170
166
-**LDAP_ORGANISATION**: Organisation name. Defaults to `Example Inc.`
171
167
-**LDAP_DOMAIN**: Ldap domain. Defaults to `example.org`
172
-
-**LDAP_ADMIN_PASSWORD** Admin password. Defaults to `admin`
168
+
-**LDAP_ADMIN_PASSWORD** Ldap Admin password. Defaults to `admin`
169
+
-**LDAP_CONFIG_PASSWORD** Ldap Config password. Defaults to `config`
173
170
174
171
TLS options :
175
172
-**USE_TLS**: Add openldap TLS capabilities. Defaults to `true`
@@ -187,12 +184,12 @@ Replication options :
187
184
188
185
Environment variable can be set directly by adding the -e argument in the command line, for example :
189
186
190
-
docker run -h ldap.example.org -e LDAP_ORGANISATION="My Compagny" -e LDAP_DOMAIN="my-compagny.com" \
187
+
docker run -e LDAP_ORGANISATION="My Compagny" -e LDAP_DOMAIN="my-compagny.com" \
0 commit comments