diff --git a/5.6/docker-entrypoint.sh b/5.6/docker-entrypoint.sh index 6f0f1316f..d49f92f9f 100755 --- a/5.6/docker-entrypoint.sh +++ b/5.6/docker-entrypoint.sh @@ -35,6 +35,12 @@ file_env() { elif [ "${!fileVar:-}" ]; then val="$(< "${!fileVar}")" fi + # remove newline from values which would cause troubles later if present + new_val=$(echo "$val"|tr -d '\n') + if [ "$new_val" != "$val" ]; then + mysql_warn "Stripping newline from ${var}." + val="$new_val" + fi export "$var"="$val" unset "$fileVar" } diff --git a/5.7/docker-entrypoint.sh b/5.7/docker-entrypoint.sh index 6f0f1316f..d49f92f9f 100755 --- a/5.7/docker-entrypoint.sh +++ b/5.7/docker-entrypoint.sh @@ -35,6 +35,12 @@ file_env() { elif [ "${!fileVar:-}" ]; then val="$(< "${!fileVar}")" fi + # remove newline from values which would cause troubles later if present + new_val=$(echo "$val"|tr -d '\n') + if [ "$new_val" != "$val" ]; then + mysql_warn "Stripping newline from ${var}." + val="$new_val" + fi export "$var"="$val" unset "$fileVar" } diff --git a/8.0/docker-entrypoint.sh b/8.0/docker-entrypoint.sh index 6f0f1316f..d49f92f9f 100755 --- a/8.0/docker-entrypoint.sh +++ b/8.0/docker-entrypoint.sh @@ -35,6 +35,12 @@ file_env() { elif [ "${!fileVar:-}" ]; then val="$(< "${!fileVar}")" fi + # remove newline from values which would cause troubles later if present + new_val=$(echo "$val"|tr -d '\n') + if [ "$new_val" != "$val" ]; then + mysql_warn "Stripping newline from ${var}." + val="$new_val" + fi export "$var"="$val" unset "$fileVar" }