Skip to content

Commit 6d8865b

Browse files
committed
Merge branch 'feature-postfix-link' into release-0.10.0
2 parents 5f1e17b + 0e43417 commit 6d8865b

Some content is hidden

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

57 files changed

+1015
-400
lines changed

CHANGELOG.md

Whitespace-only changes.

Dockerfile

Lines changed: 0 additions & 47 deletions
This file was deleted.

Makefile

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

0 commit comments

Comments
 (0)