Skip to content

Commit 30a2f53

Browse files
committed
docs
1 parent e5c84a6 commit 30a2f53

File tree

3 files changed

+126
-14
lines changed

3 files changed

+126
-14
lines changed

README.md

Lines changed: 60 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ A docker image to run phpLDAPadmin.
99

1010
Run a phpLDAPadmin docker image by replacing `ldap.example.com` with your ldap host or IP :
1111

12-
sudo docker run -p 443:443 \
13-
--env PHPLDAPADMIN_LDAP_HOSTS=ldap.example.com \
14-
--detach osixia/phpldapadmin:0.6.7
12+
docker run -p 6443:443 \
13+
--env PHPLDAPADMIN_LDAP_HOSTS=ldap.example.com \
14+
--detach osixia/phpldapadmin:0.6.7
1515

16-
That's it :) you can access phpLDAPadmin on [https://localhost](https://localhost)
16+
That's it :) you can access phpLDAPadmin on [https://localhost:6443](https://localhost:6443)
1717

1818
## Beginner Guide
1919

@@ -135,19 +135,44 @@ Ldap client TLS/LDAPS :
135135

136136
More information at : http://www.openldap.org/doc/admin24/tls.html (16.2.2. Client Configuration)
137137

138-
### Set environment variables at run time :
138+
### Set your own environment variables
139139

140-
Environment variable can be set directly by adding the -e argument in the command line, for example :
140+
#### Use command line argument
141+
Environment variables can be set by adding the --env argument in the command line, for example:
141142

142-
docker run -h phpldapadmin.example.org -e PHPLDAPADMIN_LDAP_HOSTS="ldap.example.org" \
143-
-d osixia/phpldapadmin
143+
docker run --env PHPLDAPADMIN_LDAP_HOSTS="ldap.example.org" \
144+
--detach osixia/phpldapadmin:0.6.7
145+
146+
#### Link environment file
147+
148+
For example if your environment file is in : /data/ldap/environment/my-env.yaml
149+
150+
docker run --volume /data/ldap/environment/my-env.yaml:/container/environment/01-custom/env.yaml \
151+
--detach osixia/phpldapadmin:0.6.7
152+
153+
Take care to link your environment file 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).
154+
155+
#### Make your own image or extend this image
156+
157+
This is the best solution if you have a private registry. Please refer to the [Advanced User Guide](#advanced-user-guide) just below.
158+
159+
## Advanced User Guide
160+
161+
### Extend osixia/openldap:1.1.0 image
162+
163+
If you need to add your custom TLS certificate, bootstrap config or environment files the easiest way is to extends this image.
144164

145-
Or by setting your own `env.yaml` file as a docker volume to `/container/environment/env.yaml`
165+
Dockerfile example:
146166

147-
docker run -h ldap.example.org -v /data/my-env.yaml:/container/environment/env.yaml \
148-
-d osixia/openldap
167+
FROM osixia/phpldapadmin:0.6.7
168+
MAINTAINER Your Name <your@name.com>
149169

150-
## Manual build
170+
ADD https-certs /container/service/phpldapadmin/assets/apache2/certs
171+
ADD ldap-certs /container/service/ldap-client/assets/certs
172+
ADD environment /container/environment/01-custom
173+
174+
175+
### Make your own phpLDAPadmin image
151176

152177
Clone this project :
153178

@@ -157,12 +182,14 @@ Clone this project :
157182
Adapt Makefile, set your image NAME and VERSION, for example :
158183

159184
NAME = osixia/phpldapadmin
160-
VERSION = 0.6.4
185+
VERSION = 0.6.7
161186

162187
becomes :
163188
NAME = billy-the-king/phpldapadmin
164189
VERSION = 0.1.0
165190

191+
Add your custom certificate and environment files...
192+
166193
Build your image :
167194

168195
make build
@@ -171,7 +198,7 @@ Run your image :
171198

172199
docker run -d billy-the-king/phpldapadmin:0.1.0
173200

174-
## Tests
201+
### Tests
175202

176203
We use **Bats** (Bash Automated Testing System) to test this image:
177204

@@ -180,3 +207,22 @@ We use **Bats** (Bash Automated Testing System) to test this image:
180207
Install Bats, and in this project directory run :
181208

182209
make test
210+
211+
### Kubernetes
212+
213+
Kubernetes is an open source system for managing containerized applications across multiple hosts, providing basic mechanisms for deployment, maintenance, and scaling of applications.
214+
215+
More information:
216+
- http://kubernetes.io
217+
- https://github.com/kubernetes/kubernetes
218+
219+
An osixia-phpldapadmin kubernetes example is available in **example/kubernetes**
220+
221+
### Under the hood: osixia/web-baseimage
222+
223+
This image is based on osixia/web-baseimage.
224+
More info: https://github.com/osixia/docker-web-baseimage
225+
226+
## Changelog
227+
228+
Please refer to: [CHANGELOG.md](CHANGELOG.md)
Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
apiVersion: v1
2+
kind: ReplicationController
3+
metadata:
4+
name: phpldapadmin-controller
5+
labels:
6+
app: phpldapadmin
7+
spec:
8+
replicas: 1
9+
selector:
10+
app: phpldapadmin
11+
template:
12+
metadata:
13+
labels:
14+
app: phpldapadmin
15+
spec:
16+
containers:
17+
- name: phpldapadmin
18+
image: osixia/phpldapadmin:0.6.6
19+
volumeMounts:
20+
- name: phpldapadmin-certs
21+
mountPath: /container/service/phpldapadmin/assets/apache2/certs
22+
- name: ldap-client-certs
23+
mountPath: /container/service/ldap-client/assets/certs
24+
ports:
25+
- containerPort: 443
26+
env:
27+
- name: PHPLDAPADMIN_LDAP_HOSTS
28+
value: "[{'ldap.example.org': [{'server': [{'tls': 'true'}]}]}]"
29+
- name: PHPLDAPADMIN_SERVER_ADMIN
30+
value: "webmaster@example.org"
31+
- name: PHPLDAPADMIN_HTTPS
32+
value: "true"
33+
- name: PHPLDAPADMIN_HTTPS_CRT_FILENAME
34+
value: "cert.crt"
35+
- name: PHPLDAPADMIN_HTTPS_KEY_FILENAME
36+
value: "cert.key"
37+
- name: PHPLDAPADMIN_HTTPS_CA_CRT_FILENAME
38+
value: "ca.crt"
39+
- name: PHPLDAPADMIN_LDAP_CLIENT_TLS
40+
value: "true"
41+
- name: PHPLDAPADMIN_LDAP_CLIENT_TLS_REQCERT
42+
value: "demand"
43+
- name: PHPLDAPADMIN_LDAP_CLIENT_TLS_CRT_FILENAME
44+
value: "cert.crt"
45+
- name: PHPLDAPADMIN_LDAP_CLIENT_TLS_KEY_FILENAME
46+
value: "cert.key"
47+
- name: PHPLDAPADMIN_LDAP_CLIENT_TLS_CA_CRT_FILENAME
48+
value: "ca.crt"
49+
volumes:
50+
- name: phpldapadmin-certs
51+
hostPath:
52+
path: "/data/phpldapadmin/ssl/"
53+
- name: ldap-client-certs
54+
hostPath:
55+
path: "/data/phpldapadmin/ldap-client-certs/"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
apiVersion: v1
2+
kind: Service
3+
metadata:
4+
labels:
5+
app: phpldapadmin
6+
name: phpldapadmin-service
7+
spec:
8+
ports:
9+
- port: 443
10+
selector:
11+
app: phpldapadmin

0 commit comments

Comments
 (0)