allow adding additional mysql params to cmd

This commit is contained in:
Asif Bacchus 2020-11-28 01:24:37 -07:00
parent 028e52e817
commit 7b2bd5732b
1 changed files with 18 additions and 3 deletions

View File

@ -112,9 +112,24 @@ for f in /docker-entrypoint-postinit.d/*.sh; do
fi
done
# execute commands passed to this container
# note initialization complete and display root password
printf "\nInitialization complete...\n"
printf "(sql root password: %s)\n\n" "$MYSQL_ROOT_PASSWORD"
exec "$@"
printf "(mySQL root password: %s)\n\n" "$MYSQL_ROOT_PASSWORD"
# process CMD sent to this container
case "$1" in
-*)
# param starts with '-' --> assume mysqld options and append to CMD
set -- /usr/bin/mysqld --user=mysql --console --skip-name-resolve --skip-networking=0 "$@"
printf "\nExecuting: %s\n" "$*"
exec "$@"
;;
*)
# param does NOT start with '-' --> execute as given
printf "\nExecuting: %s\n" "$@"
exec "$@"
;;
esac
exit 0
#EOF