docker-openldap icon indicating copy to clipboard operation
docker-openldap copied to clipboard

ignore set -e at grep SLAPD_

Open tetsuyainfra opened this issue 8 years ago • 1 comments

Because "set -e option in entrypoint.sh" if env | grep SLAPD_ (don't set SLAPD_* env) returned an error, shell script stops.

  • posix set -e http://pubs.opengroup.org/onlinepubs/007904975/utilities/set.html
  • grep Exit-status https://www.gnu.org/software/grep/manual/grep.html#Exit-Status
// Reproduce commands
docker volume create --name etc_ldap
docker volume create --name var_ldap

// 1st execution 
docker run -d \
  -e SLAPD_PASSWORD=mysecretpassword  \
  -e SLAPD_DOMAIN=ldap.example.org    \
  -v etc_ldap:/etc/ldap               \
  -v var_ldap:/var/lib/ldap           \
  dinkel/openldap

// 2nd execution ends immediately
docker run -d \
  -v etc_ldap:/etc/ldap               \
  -v var_ldap:/var/lib/ldap           \
  dinkel/openldap
// OR 
docker run -it \
  -v etc_ldap:/etc/ldap               \
  -v var_ldap:/var/lib/ldap           \
  dinkel/openldap

tetsuyainfra avatar Jan 05 '17 08:01 tetsuyainfra

Why not use bashism ? :)

$ echo ${!SSH_*}
SSH_AGENT_PID SSH_AUTH_SOCK

bersace avatar Jun 23 '17 06:06 bersace