From 7b2bd5732ba42b3fe08622fc53b4398831de6968 Mon Sep 17 00:00:00 2001 From: Asif Bacchus Date: Sat, 28 Nov 2020 01:24:37 -0700 Subject: [PATCH] allow adding additional mysql params to cmd --- entrypoint.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/entrypoint.sh b/entrypoint.sh index 6c4b49a..427dc7a 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -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 \ No newline at end of file