Skip to content

Commit fa517c2

Browse files
committed
Merge branch 'release-1.3.0' into stable
2 parents 5a3bd46 + 8f5ff0a commit fa517c2

13 files changed

+214
-74
lines changed

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
1-
/.*
21
!/.git*
32
/VOLUMES

.travis.yml

+106
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
language: bash
2+
3+
services:
4+
- docker
5+
env:
6+
global:
7+
- NAME="osixia/openldap"
8+
- VERSION="${TRAVIS_BRANCH}-dev"
9+
matrix:
10+
- TARGET_ARCH=amd64 QEMU_ARCH=x86_64
11+
- TARGET_ARCH=arm32v7 QEMU_ARCH=arm
12+
- TARGET_ARCH=arm64v8 QEMU_ARCH=aarch64
13+
14+
addons:
15+
apt:
16+
# The docker manifest command was added in docker-ee version 18.x
17+
# So update our current installation and we also have to enable the experimental features.
18+
sources:
19+
- sourceline: "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable"
20+
key_url: "https://download.docker.com/linux/ubuntu/gpg"
21+
packages:
22+
- docker-ce
23+
24+
before_install:
25+
- docker --version
26+
- mkdir $HOME/.docker
27+
- 'echo "{" > $HOME/.docker/config.json'
28+
- 'echo " \"experimental\": \"enabled\"" >> $HOME/.docker/config.json'
29+
- 'echo "}" >> $HOME/.docker/config.json'
30+
- sudo service docker restart
31+
32+
install:
33+
# For cross buidling our images
34+
# This is necessary because travis-ci.org has only x86_64 machines.
35+
# If travis-ci.org gets native arm builds, probably this step is not
36+
# necessary any more.
37+
- docker run --rm --privileged multiarch/qemu-user-static:register --reset
38+
# Bats is necessary for the UT
39+
- curl -o bats.tar.gz -SL https://github.com/bats-core/bats-core/archive/v1.1.0.tar.gz
40+
- mkdir bats-core && tar -xf bats.tar.gz -C bats-core --strip-components=1
41+
- cd bats-core/
42+
- sudo ./install.sh /usr/local
43+
- cd ..
44+
45+
before_script:
46+
# Set baseimage.
47+
# remove pqchecker if arch is not amd64
48+
- sed -i -e "s/FROM \(.*\)/FROM \1-${TARGET_ARCH}/g" image/Dockerfile;
49+
- if [[ "${TARGET_ARCH}" != 'amd64' ]]; then
50+
sed -i -e "/PQCHECKER/Id" image/Dockerfile;
51+
fi
52+
- cat image/Dockerfile;
53+
# If this is a tag then change the VERSION variable to only have the
54+
# tag name and not also the commit hash.
55+
- if [ -n "$TRAVIS_TAG" ]; then
56+
VERSION=$(echo "${TRAVIS_TAG}" | sed -e 's/\(.*\)[-v]\(.*\)/\1\2/g');
57+
fi
58+
59+
script:
60+
- make build-nocache NAME=${NAME} VERSION=${VERSION}-${TARGET_ARCH}
61+
# skip test "ldapsearch existing hdb database and config" if arch != amd64
62+
- if [[ "${TARGET_ARCH}" != 'amd64' ]]; then
63+
sed -i '/@test "ldapsearch existing hdb database and config"/a skip' test/test.bats;
64+
fi
65+
# Run the test and if the test fails mark the build as failed.
66+
- make test NAME=${NAME} VERSION=${VERSION}-${TARGET_ARCH}
67+
68+
before_deploy:
69+
- docker run -d --name test_image ${NAME}:${VERSION}-${TARGET_ARCH} sleep 10
70+
- sleep 5
71+
- sudo docker ps | grep -q test_image
72+
# To have `DOCKER_USER` and `DOCKER_PASS`
73+
# use `travis env set`.
74+
- docker login -u "$DOCKER_USER" -p "$DOCKER_PASS";
75+
- make tag NAME=${NAME} VERSION=${VERSION}-${TARGET_ARCH}
76+
77+
deploy:
78+
provider: script
79+
on:
80+
all_branches: true
81+
script: make push NAME=${NAME} VERSION=${VERSION}-${TARGET_ARCH}
82+
83+
jobs:
84+
include:
85+
- stage: Manifest creation
86+
install: skip
87+
script: skip
88+
after_deploy:
89+
- docker login -u "$DOCKER_USER" -p "$DOCKER_PASS";
90+
- docker manifest create ${NAME}:${VERSION} ${NAME}:${VERSION}-amd64 ${NAME}:${VERSION}-arm32v7 ${NAME}:${VERSION}-arm64v8;
91+
docker manifest annotate ${NAME}:${VERSION} ${NAME}:${VERSION}-amd64 --os linux --arch amd64;
92+
docker manifest annotate ${NAME}:${VERSION} ${NAME}:${VERSION}-arm32v7 --os linux --arch arm --variant v7;
93+
docker manifest annotate ${NAME}:${VERSION} ${NAME}:${VERSION}-arm64v8 --os linux --arch arm64 --variant v8;
94+
95+
# The latest tag is coming from the stable branch of the repo
96+
- if [ "${TRAVIS_BRANCH}" == 'stable' ]; then
97+
docker manifest create ${NAME}:latest ${NAME}:${VERSION}-amd64 ${NAME}:${VERSION}-arm32v7 ${NAME}:${VERSION}-arm64v8;
98+
docker manifest annotate ${NAME}:latest ${NAME}:${VERSION}-amd64 --os linux --arch amd64;
99+
docker manifest annotate ${NAME}:latest ${NAME}:${VERSION}-arm32v7 --os linux --arch arm --variant v7;
100+
docker manifest annotate ${NAME}:latest ${NAME}:${VERSION}-arm64v8 --os linux --arch arm64 --variant v8;
101+
fi
102+
103+
- docker manifest push ${NAME}:${VERSION};
104+
if [ "${TRAVIS_BRANCH}" == 'stable' ]; then
105+
docker manifest push ${NAME}:latest;
106+
fi

CHANGELOG.md

+8
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,14 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
55
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
66

7+
## [1.3.0] - 2019-09-29
8+
## Added
9+
- Multiarch support
10+
11+
## Changes
12+
- Update openldap 2.4.47 to 2.4.48 #247
13+
- Upgrade baseimage to light-baseimage:1.2.0 (debian buster)
14+
715
## [1.2.5] - 2019-08-16
816
## Added
917
- Support for docker secrets #325. Thanks to @anagno !

Makefile

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
NAME = osixia/openldap
2-
VERSION = 1.2.5
2+
VERSION = 1.3.0
33

44
.PHONY: build build-nocache test tag-latest push push-latest release git-tag-version
55

@@ -12,6 +12,9 @@ build-nocache:
1212
test:
1313
env NAME=$(NAME) VERSION=$(VERSION) bats test/test.bats
1414

15+
tag:
16+
docker tag $(NAME):$(VERSION) $(NAME):$(VERSION)
17+
1518
tag-latest:
1619
docker tag $(NAME):$(VERSION) $(NAME):latest
1720

README.md

+55-55
Original file line numberDiff line numberDiff line change
@@ -4,48 +4,48 @@
44
![Docker Stars](https://img.shields.io/docker/stars/osixia/openldap.svg)
55
![](https://images.microbadger.com/badges/image/osixia/openldap.svg)
66

7-
Latest release: 1.2.5 - OpenLDAP 2.4.47 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/openldap/) 
7+
Latest release: 1.3.0 - OpenLDAP 2.4.48 - [Changelog](CHANGELOG.md) | [Docker Hub](https://hub.docker.com/r/osixia/openldap/) 
88

99
**A docker image to run OpenLDAP.**
1010

1111
> OpenLDAP website : [www.openldap.org](http://www.openldap.org/)
1212
1313

1414
- [osixia/openldap](#osixiaopenldap)
15-
- [Contributing](#Contributing)
16-
- [Quick Start](#Quick-Start)
17-
- [Beginner Guide](#Beginner-Guide)
18-
- [Create new ldap server](#Create-new-ldap-server)
19-
- [Data persistence](#Data-persistence)
20-
- [Edit your server configuration](#Edit-your-server-configuration)
21-
- [Seed ldap database with ldif](#Seed-ldap-database-with-ldif)
22-
- [Use an existing ldap database](#Use-an-existing-ldap-database)
23-
- [Backup](#Backup)
24-
- [Administrate your ldap server](#Administrate-your-ldap-server)
25-
- [TLS](#TLS)
26-
- [Use auto-generated certificate](#Use-auto-generated-certificate)
27-
- [Use your own certificate](#Use-your-own-certificate)
28-
- [Disable TLS](#Disable-TLS)
29-
- [Multi master replication](#Multi-master-replication)
30-
- [Fix docker mounted file problems](#Fix-docker-mounted-file-problems)
31-
- [Debug](#Debug)
32-
- [Environment Variables](#Environment-Variables)
33-
- [Default.yaml](#Defaultyaml)
34-
- [Default.startup.yaml](#Defaultstartupyaml)
35-
- [Set your own environment variables](#Set-your-own-environment-variables)
36-
- [Use command line argument](#Use-command-line-argument)
37-
- [Link environment file](#Link-environment-file)
38-
- [Docker Secrets](#Docker-Secrets)
39-
- [Make your own image or extend this image](#Make-your-own-image-or-extend-this-image)
40-
- [Advanced User Guide](#Advanced-User-Guide)
41-
- [Extend osixia/openldap:1.2.5 image](#Extend-osixiaopenldap125-dev-image)
42-
- [Make your own openldap image](#Make-your-own-openldap-image)
43-
- [Tests](#Tests)
44-
- [Kubernetes](#Kubernetes)
45-
- [Under the hood: osixia/light-baseimage](#Under-the-hood-osixialight-baseimage)
46-
- [Security](#Security)
47-
- [Known security issues](#Known-security-issues)
48-
- [Changelog](#Changelog)
15+
- [Contributing](#contributing)
16+
- [Quick Start](#quick-start)
17+
- [Beginner Guide](#beginner-guide)
18+
- [Create new ldap server](#create-new-ldap-server)
19+
- [Data persistence](#data-persistence)
20+
- [Edit your server configuration](#edit-your-server-configuration)
21+
- [Seed ldap database with ldif](#seed-ldap-database-with-ldif)
22+
- [Use an existing ldap database](#use-an-existing-ldap-database)
23+
- [Backup](#backup)
24+
- [Administrate your ldap server](#administrate-your-ldap-server)
25+
- [TLS](#tls)
26+
- [Use auto-generated certificate](#use-auto-generated-certificate)
27+
- [Use your own certificate](#use-your-own-certificate)
28+
- [Disable TLS](#disable-tls)
29+
- [Multi master replication](#multi-master-replication)
30+
- [Fix docker mounted file problems](#fix-docker-mounted-file-problems)
31+
- [Debug](#debug)
32+
- [Environment Variables](#environment-variables)
33+
- [Default.yaml](#defaultyaml)
34+
- [Default.startup.yaml](#defaultstartupyaml)
35+
- [Set your own environment variables](#set-your-own-environment-variables)
36+
- [Use command line argument](#use-command-line-argument)
37+
- [Link environment file](#link-environment-file)
38+
- [Docker Secrets](#docker-secrets)
39+
- [Make your own image or extend this image](#make-your-own-image-or-extend-this-image)
40+
- [Advanced User Guide](#advanced-user-guide)
41+
- [Extend osixia/openldap:1.3.0 image](#extend-osixiaopenldap130-image)
42+
- [Make your own openldap image](#make-your-own-openldap-image)
43+
- [Tests](#tests)
44+
- [Kubernetes](#kubernetes)
45+
- [Under the hood: osixia/light-baseimage](#under-the-hood-osixialight-baseimage)
46+
- [Security](#security)
47+
- [Known security issues](#known-security-issues)
48+
- [Changelog](#changelog)
4949

5050
## Contributing
5151

@@ -58,11 +58,11 @@ If you find this image useful here's how you can help:
5858
## Quick Start
5959
Run OpenLDAP docker image:
6060

61-
docker run --name my-openldap-container --detach osixia/openldap:1.2.5
61+
docker run --name my-openldap-container --detach osixia/openldap:1.3.0
6262

6363
Do not forget to add the port mapping for both port 389 and 636 if you wish to access the ldap server from another machine.
6464

65-
docker run -p 389:389 -p 636:636 --name my-openldap-container --detach osixia/openldap:1.2.5
65+
docker run -p 389:389 -p 636:636 --name my-openldap-container --detach osixia/openldap:1.3.0
6666

6767
Either command starts a new container with OpenLDAP running inside. Let's make the first search in our LDAP container:
6868

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

100100
docker run --env LDAP_ORGANISATION="My Company" --env LDAP_DOMAIN="my-company.com" \
101-
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.2.5
101+
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.3.0
102102

103103
#### Data persistence
104104

@@ -149,12 +149,12 @@ argument to entrypoint if you don't want to overwrite them.
149149
# single file example:
150150
docker run \
151151
--volume ./bootstrap.ldif:/container/service/slapd/assets/config/bootstrap/ldif/50-bootstrap.ldif \
152-
osixia/openldap:1.2.5 --copy-service
152+
osixia/openldap:1.3.0 --copy-service
153153

154154
#directory example:
155155
docker run \
156156
--volume ./ldif:/container/service/slapd/assets/config/bootstrap/ldif/custom \
157-
osixia/openldap:1.2.5 --copy-service
157+
osixia/openldap:1.3.0 --copy-service
158158

159159
### Use an existing ldap database
160160

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

166166
docker run --volume /data/slapd/database:/var/lib/ldap \
167167
--volume /data/slapd/config:/etc/ldap/slapd.d \
168-
--detach osixia/openldap:1.2.5
168+
--detach osixia/openldap:1.3.0
169169

170170
You can also use data volume containers. Please refer to:
171171
> [https://docs.docker.com/engine/tutorials/dockervolumes/](https://docs.docker.com/engine/tutorials/dockervolumes/)
@@ -185,7 +185,7 @@ If you are looking for a simple solution to administrate your ldap server you ca
185185
#### Use auto-generated certificate
186186
By default, TLS is already configured and enabled, certificate is created using container hostname (it can be set by docker run --hostname option eg: ldap.example.org).
187187

188-
docker run --hostname ldap.my-company.com --detach osixia/openldap:1.2.5
188+
docker run --hostname ldap.my-company.com --detach osixia/openldap:1.3.0
189189

190190
#### Use your own certificate
191191

@@ -195,24 +195,24 @@ You can set your custom certificate at run time, by mounting a directory contain
195195
--env LDAP_TLS_CRT_FILENAME=my-ldap.crt \
196196
--env LDAP_TLS_KEY_FILENAME=my-ldap.key \
197197
--env LDAP_TLS_CA_CRT_FILENAME=the-ca.crt \
198-
--detach osixia/openldap:1.2.5
198+
--detach osixia/openldap:1.3.0
199199

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

202202
#### Disable TLS
203203
Add --env LDAP_TLS=false to the run command:
204204

205-
docker run --env LDAP_TLS=false --detach osixia/openldap:1.2.5
205+
docker run --env LDAP_TLS=false --detach osixia/openldap:1.3.0
206206

207207
### Multi master replication
208208
Quick example, with the default config.
209209

210210
#Create the first ldap server, save the container id in LDAP_CID and get its IP:
211-
LDAP_CID=$(docker run --hostname ldap.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.2.5)
211+
LDAP_CID=$(docker run --hostname ldap.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.3.0)
212212
LDAP_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $LDAP_CID)
213213

214214
#Create the second ldap server, save the container id in LDAP2_CID and get its IP:
215-
LDAP2_CID=$(docker run --hostname ldap2.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.2.5)
215+
LDAP2_CID=$(docker run --hostname ldap2.example.org --env LDAP_REPLICATION=true --detach osixia/openldap:1.3.0)
216216
LDAP2_IP=$(docker inspect -f "{{ .NetworkSettings.IPAddress }}" $LDAP2_CID)
217217

218218
#Add the pair "ip hostname" to /etc/hosts on each containers,
@@ -248,7 +248,7 @@ You may have some problems with mounted files on some systems. The startup scrip
248248

249249
To fix that run the container with `--copy-service` argument :
250250

251-
docker run [your options] osixia/openldap:1.2.5 --copy-service
251+
docker run [your options] osixia/openldap:1.3.0 --copy-service
252252

253253
### Debug
254254

@@ -257,11 +257,11 @@ Available levels are: `none`, `error`, `warning`, `info`, `debug` and `trace`.
257257

258258
Example command to run the container in `debug` mode:
259259

260-
docker run --detach osixia/openldap:1.2.5 --loglevel debug
260+
docker run --detach osixia/openldap:1.3.0 --loglevel debug
261261

262262
See all command line options:
263263

264-
docker run osixia/openldap:1.2.5 --help
264+
docker run osixia/openldap:1.3.0 --help
265265

266266

267267
## Environment Variables
@@ -327,7 +327,7 @@ Replication options:
327327

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

330-
docker run --env LDAP_REPLICATION_HOSTS="#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']" --detach osixia/openldap:1.2.5
330+
docker run --env LDAP_REPLICATION_HOSTS="#PYTHON2BASH:['ldap://ldap.example.org','ldap://ldap2.example.org']" --detach osixia/openldap:1.3.0
331331

332332
To convert yaml to python online: http://yaml-online-parser.appspot.com/
333333

@@ -348,7 +348,7 @@ Other environment variables:
348348
Environment variables can be set by adding the --env argument in the command line, for example:
349349

350350
docker run --env LDAP_ORGANISATION="My company" --env LDAP_DOMAIN="my-company.com" \
351-
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.2.5
351+
--env LDAP_ADMIN_PASSWORD="JonSn0w" --detach osixia/openldap:1.3.0
352352

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

361361
docker run --volume /data/ldap/environment:/container/environment/01-custom \
362-
--detach osixia/openldap:1.2.5
362+
--detach osixia/openldap:1.3.0
363363

364364
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).
365365

366366
Note: the container will try to delete the **\*.startup.yaml** 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 **\*.startup.yaml**:
367367

368368
docker run --volume /data/ldap/environment/my-env.yaml:/container/environment/01-custom/env.yaml \
369-
--detach osixia/openldap:1.2.5
369+
--detach osixia/openldap:1.3.0
370370

371371
#### Docker Secrets
372372

@@ -385,13 +385,13 @@ This is the best solution if you have a private registry. Please refer to the [A
385385

386386
## Advanced User Guide
387387

388-
### Extend osixia/openldap:1.2.5 image
388+
### Extend osixia/openldap:1.3.0 image
389389

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

392392
Dockerfile example:
393393

394-
FROM osixia/openldap:1.2.5
394+
FROM osixia/openldap:1.3.0
395395
MAINTAINER Your Name <[email protected]>
396396

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

example/docker-compose.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
version: '2'
22
services:
33
openldap:
4-
image: osixia/openldap:1.2.5
4+
image: osixia/openldap:1.3.0
55
container_name: openldap
66
environment:
77
LDAP_LOG_LEVEL: "256"

0 commit comments

Comments
 (0)