From fcee0594d43d468717d856fd760370dca7da998f Mon Sep 17 00:00:00 2001 From: Mauro Torrez Date: Sat, 12 Oct 2019 10:25:22 -0300 Subject: [PATCH] custom entrypoint with ulimit --- Dockerfile | 1 + entrypoint.sh | 6 ++++++ setup | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 entrypoint.sh diff --git a/Dockerfile b/Dockerfile index 8ed1e9c..89604ff 100644 --- a/Dockerfile +++ b/Dockerfile @@ -30,6 +30,7 @@ RUN apt-get update \ ADD setup /start.d ADD confd /etc/confd/ +ADD entrypoint.sh / EXPOSE 389 diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..fd9967a --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,6 @@ +#!/bin/bash +set -e +/usr/local/bin/confd -onetime -backend env +run-parts -v /start.d +ulimit -n 1024 +exec ${@} diff --git a/setup b/setup index 18a9906..2eb12e3 100755 --- a/setup +++ b/setup @@ -4,7 +4,7 @@ assert(){ [[ $? -eq 0 ]] || { [[ -n ${1} ]] && echo ${@} ; exit 1 ; } } # from https://github.com/dinkel/docker-openldap/blob/master/entrypoint.sh: # When not limiting the open file descritors limit, the memory consumption of # slapd is absurdly high. See https://github.com/docker/docker/issues/8231 -ulimit -n 8192 +ulimit -n 1024 chown -R openldap:openldap /var/lib/ldap assert "FATAL: could not set required directory permissions"