Browse Source

follow best pratices

ofreax 9 years ago
parent
commit
37e9eec6e7
2 changed files with 9 additions and 3 deletions
  1. 4 3
      image/Dockerfile
  2. 5 0
      image/service/slapd/install.sh

+ 4 - 3
image/Dockerfile

@@ -6,14 +6,15 @@ MAINTAINER Bertrand Gouny <[email protected]>
 # Add openldap user and group first to make sure their IDs get assigned consistently, regardless of whatever dependencies get added
 RUN groupadd -r openldap && useradd -r -g openldap openldap
 
-# Install OpenLDAP, ldap-utils and cfssl from baseimage and remove default ldap db
+# Install OpenLDAP, ldap-utils and cfssl from baseimage
 # sources: https://github.com/osixia/docker-light-baseimage/blob/stable/image/tool/add-service-available
 #          https://github.com/osixia/docker-light-baseimage/blob/stable/image/service-available/.cfssl/download.sh
 RUN apt-get -y update \
     && /container/tool/add-service-available .cfssl \
 	  && LC_ALL=C DEBIAN_FRONTEND=noninteractive apt-get install -y --force-yes --no-install-recommends \
-       slapd ldap-utils openssl \
-	  && rm -rf /var/lib/ldap /etc/ldap/slapd.d
+       ldap-utils \
+       openssl \
+       slapd
 
 # Add service directory to /container/service
 ADD service /container/service

+ 5 - 0
image/service/slapd/install.sh

@@ -0,0 +1,5 @@
+#!/bin/bash -e
+# this script is run during the image build
+
+# remove default ldap db
+rm -rf /var/lib/ldap /etc/ldap/slapd.d