Skip to content

Commit 469a9bf

Browse files
committed
Merge branch 'release-0.10.0' into stable
2 parents 9964ef4 + ce67e92 commit 469a9bf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+1018
-216
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
## 0.10.0 (release date: 2015-03-03)
2+
- New version initial release

Makefile

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,22 @@
11
NAME = osixia/openldap
2-
VERSION = 0.9.2
2+
VERSION = 0.10.0
33

44
.PHONY: all build test tag_latest release
55

66
all: build
77

88
build:
9-
docker.io build -t $(NAME):$(VERSION) --rm .
9+
docker build -t $(NAME):$(VERSION) --rm image
1010

1111
test:
12-
env NAME=$(NAME) VERSION=$(VERSION) ./test.sh debug
12+
env NAME=$(NAME) VERSION=$(VERSION) bats test/test.bats
1313

1414
tag_latest:
15-
docker.io tag $(NAME):$(VERSION) $(NAME):latest
15+
docker tag -f $(NAME):$(VERSION) $(NAME):latest
1616

1717
release: build test tag_latest
18-
@if ! docker.io images $(NAME) | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME) version $(VERSION) is not yet built. Please run 'make build'"; false; fi
19-
docker.io push $(NAME)
20-
@echo "*** Don't forget to run 'twgit release finish' :)"
18+
@if ! docker images $(NAME) | awk '{ print $$2 }' | grep -q -F $(VERSION); then echo "$(NAME) version $(VERSION) is not yet built. Please run 'make build'"; false; fi
19+
@if ! head -n 1 CHANGELOG.md | grep -q 'release date'; then echo 'Please note the release date in Changelog.md.' && false; fi
20+
docker push $(NAME)
21+
@echo "*** Don't forget to run 'twgit release/hotfix finish' :)"
2122

README.md

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -5,29 +5,4 @@ https://github.com/nickstenning/docker-slapd
55

66
Add support of tls.
77

8-
### How to use tls
9-
10-
Add `-v some/host/dir:/etc/ldap/ssl` and `--dns=127.0.0.1` to the run command.
11-
12-
`some/host/dir` must contain a least 3 files :
13-
- `ca.crt` certificate authority certificate
14-
- `ldap.crt` ldap server certificate
15-
- `ldap.key` ldap server certificate private key
16-
17-
and optionaly `dhparam.pem` this file is genereted automaticaly if not present.
18-
19-
`--dns=127.0.0.1` allow to use the certificate cn correctly.
20-
21-
22-
### Example
23-
24-
docker run --dns=127.0.0.1 \
25-
-v /data/ldap/db:/var/lib/ldap \
26-
-v /data/ldap/config:/etc/ldap/slapd.d \
27-
-v /data/ldap/ssl/:/etc/ldap/ssl \
28-
-v /data/ldap/log/:/var/log \
29-
-e LDAP_DOMAIN=example.com \
30-
-e LDAP_ORGANISATION="Example Corp." \
31-
-e LDAP_ROOTPASS=toor \
32-
-p 389:389 -d osixia/openldap
33-
8+
Use docker 1.5.0

image/Dockerfile

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM osixia/baseimage:0.10.3
2+
MAINTAINER Bertrand Gouny <[email protected]>
3+
4+
# Use baseimage-docker's init system.
5+
CMD ["/sbin/my_init"]
6+
7+
# Add openldap user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
8+
RUN groupadd -r openldap && useradd -r -g openldap openldap
9+
10+
# Install OpenLDAP and ldap-utils (and ssl-kit from baseimage), remove default ldap db
11+
RUN apt-get -y update && /sbin/enable-service ssl-kit \
12+
&& LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes --no-install-recommends slapd ldap-utils \
13+
&& rm -rf /var/lib/ldap
14+
15+
# Add install script and OpenLDAP assets
16+
ADD service/install.sh /tmp/install.sh
17+
ADD service/slapd/assets /osixia/slapd
18+
19+
# Run install script and clean all
20+
RUN ./tmp/install.sh \
21+
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
22+
23+
# Add default env variables
24+
ADD env.yml /etc/env.yml
25+
26+
# Add OpenLDAP container start config & daemon
27+
ADD service/slapd/container-start.sh /etc/my_init.d/slapd
28+
ADD service/slapd/daemon.sh /etc/service/slapd/run
29+
30+
# Set OpenLDAP data and config directories in a data volume
31+
VOLUME ["/var/lib/ldap", "/etc/ldap/slapd.d"]
32+
33+
# Expose ldap default port
34+
EXPOSE 389

image/env.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
LDAP_ORGANISATION: Example Inc.
2+
LDAP_DOMAIN: example.org
3+
LDAP_ADMIN_PASSWORD: admin
4+
5+
SERVER_NAME: ldap.example.org
6+
7+
USE_TLS: true
8+
SSL_CRT_FILENAME: ldap.crt
9+
SSL_KEY_FILENAME: ldap.key
10+
SSL_CA_CRT_FILENAME: ca.crt

image/service/install.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
#!/bin/bash -e
2+
# this script is run during the image build
3+
4+
# Enable access only from docker default network and localhost
5+
echo "slapd: 172.17.0.0/255.255.0.0 127.0.0.1 : ALLOW" >> /etc/hosts.allow
6+
echo "slapd: ALL : DENY" >> /etc/hosts.allow
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add your ldif config file here
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
dn: cn=config
2+
changetype: modify
3+
replace: olcLogLevel
4+
olcLogLevel: stats
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Add your ssl crt, key and ca crt here
2+
or during docker run mount a data volume with thoses files to /osixia/slapd/ssl
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
dn: cn=config
2+
changetype: modify
3+
add: olcTLSCipherSuite
4+
olcTLSCipherSuite: SECURE256:-VERS-SSL3.0
5+
-
6+
replace: olcTLSCACertificateFile
7+
olcTLSCACertificateFile: /osixia/slapd/ssl/ca.crt
8+
-
9+
replace: olcTLSCertificateFile
10+
olcTLSCertificateFile: /osixia/slapd/ssl/ldap.crt
11+
-
12+
replace: olcTLSCertificateKeyFile
13+
olcTLSCertificateKeyFile: /osixia/slapd/ssl/ldap.key
14+
-
15+
replace: olcTLSDHParamFile
16+
olcTLSDHParamFile: /osixia/slapd/ssl/dhparam.pem
17+
-
18+
replace: olcTLSVerifyClient
19+
olcTLSVerifyClient: never

0 commit comments

Comments
 (0)