From 0bdb5b03b25fb9c5b964e1977393785b1a1d63ba Mon Sep 17 00:00:00 2001 From: Xintong Song Date: Wed, 23 Dec 2020 12:47:54 +0800 Subject: [PATCH] Update Dockerfiles for 1.12.0 release Deprecate command `native-k8` and add preparation for pass-through mode. This is to address the comments in the following docker-library/official-images PR. https://github.com/docker-library/official-images/pull/9249 --- .../docker-entrypoint.sh | 17 +++++++++++++++-- .../docker-entrypoint.sh | 17 +++++++++++++++-- .../docker-entrypoint.sh | 17 +++++++++++++++-- .../docker-entrypoint.sh | 17 +++++++++++++++-- 4 files changed, 60 insertions(+), 8 deletions(-) diff --git a/1.12/scala_2.11-java11-debian/docker-entrypoint.sh b/1.12/scala_2.11-java11-debian/docker-entrypoint.sh index 68db96b0..a83e2a21 100755 --- a/1.12/scala_2.11-java11-debian/docker-entrypoint.sh +++ b/1.12/scala_2.11-java11-debian/docker-entrypoint.sh @@ -19,6 +19,7 @@ ############################################################################### COMMAND_STANDALONE="standalone-job" +# Deprecated, should be remove in Flink release 1.13 COMMAND_NATIVE_KUBERNETES="native-k8s" COMMAND_HISTORY_SERVER="history-server" COMMAND_DISABLE_JEMALLOC="disable-jemalloc" @@ -108,7 +109,7 @@ disable_jemalloc_env() { args=("$@") if [ "$1" = "help" ]; then - printf "Usage: $(basename "$0") (jobmanager|${COMMAND_STANDALONE}|taskmanager|${COMMAND_NATIVE_KUBERNETES}|${COMMAND_HISTORY_SERVER}) [${COMMAND_DISABLE_JEMALLOC}]\n" + printf "Usage: $(basename "$0") (jobmanager|${COMMAND_STANDALONE}|taskmanager|${COMMAND_HISTORY_SERVER}) [${COMMAND_DISABLE_JEMALLOC}]\n" printf " Or $(basename "$0") help\n\n" printf "By default, Flink image adopts jemalloc as default memory allocator and will disable jemalloc if option '${COMMAND_DISABLE_JEMALLOC}' given.\n" exit 0 @@ -171,4 +172,16 @@ elif [ "$1" = "$COMMAND_NATIVE_KUBERNETES" ]; then exec $(drop_privs_cmd) bash -c "${args[@]}" fi -exec "$@" +args=("${args[@]}") + +disable_jemalloc_env args + +copy_plugins_if_required + +# Set the Flink related environments +export _FLINK_HOME_DETERMINED=true +. $FLINK_HOME/bin/config.sh +export FLINK_CLASSPATH="`constructFlinkClassPath`:$INTERNAL_HADOOP_CLASSPATHS" + +echo "Running command in pass-through mode: ${args[@]}" +exec $(drop_privs_cmd) "${args[@]}" diff --git a/1.12/scala_2.11-java8-debian/docker-entrypoint.sh b/1.12/scala_2.11-java8-debian/docker-entrypoint.sh index 68db96b0..a83e2a21 100755 --- a/1.12/scala_2.11-java8-debian/docker-entrypoint.sh +++ b/1.12/scala_2.11-java8-debian/docker-entrypoint.sh @@ -19,6 +19,7 @@ ############################################################################### COMMAND_STANDALONE="standalone-job" +# Deprecated, should be remove in Flink release 1.13 COMMAND_NATIVE_KUBERNETES="native-k8s" COMMAND_HISTORY_SERVER="history-server" COMMAND_DISABLE_JEMALLOC="disable-jemalloc" @@ -108,7 +109,7 @@ disable_jemalloc_env() { args=("$@") if [ "$1" = "help" ]; then - printf "Usage: $(basename "$0") (jobmanager|${COMMAND_STANDALONE}|taskmanager|${COMMAND_NATIVE_KUBERNETES}|${COMMAND_HISTORY_SERVER}) [${COMMAND_DISABLE_JEMALLOC}]\n" + printf "Usage: $(basename "$0") (jobmanager|${COMMAND_STANDALONE}|taskmanager|${COMMAND_HISTORY_SERVER}) [${COMMAND_DISABLE_JEMALLOC}]\n" printf " Or $(basename "$0") help\n\n" printf "By default, Flink image adopts jemalloc as default memory allocator and will disable jemalloc if option '${COMMAND_DISABLE_JEMALLOC}' given.\n" exit 0 @@ -171,4 +172,16 @@ elif [ "$1" = "$COMMAND_NATIVE_KUBERNETES" ]; then exec $(drop_privs_cmd) bash -c "${args[@]}" fi -exec "$@" +args=("${args[@]}") + +disable_jemalloc_env args + +copy_plugins_if_required + +# Set the Flink related environments +export _FLINK_HOME_DETERMINED=true +. $FLINK_HOME/bin/config.sh +export FLINK_CLASSPATH="`constructFlinkClassPath`:$INTERNAL_HADOOP_CLASSPATHS" + +echo "Running command in pass-through mode: ${args[@]}" +exec $(drop_privs_cmd) "${args[@]}" diff --git a/1.12/scala_2.12-java11-debian/docker-entrypoint.sh b/1.12/scala_2.12-java11-debian/docker-entrypoint.sh index 68db96b0..a83e2a21 100755 --- a/1.12/scala_2.12-java11-debian/docker-entrypoint.sh +++ b/1.12/scala_2.12-java11-debian/docker-entrypoint.sh @@ -19,6 +19,7 @@ ############################################################################### COMMAND_STANDALONE="standalone-job" +# Deprecated, should be remove in Flink release 1.13 COMMAND_NATIVE_KUBERNETES="native-k8s" COMMAND_HISTORY_SERVER="history-server" COMMAND_DISABLE_JEMALLOC="disable-jemalloc" @@ -108,7 +109,7 @@ disable_jemalloc_env() { args=("$@") if [ "$1" = "help" ]; then - printf "Usage: $(basename "$0") (jobmanager|${COMMAND_STANDALONE}|taskmanager|${COMMAND_NATIVE_KUBERNETES}|${COMMAND_HISTORY_SERVER}) [${COMMAND_DISABLE_JEMALLOC}]\n" + printf "Usage: $(basename "$0") (jobmanager|${COMMAND_STANDALONE}|taskmanager|${COMMAND_HISTORY_SERVER}) [${COMMAND_DISABLE_JEMALLOC}]\n" printf " Or $(basename "$0") help\n\n" printf "By default, Flink image adopts jemalloc as default memory allocator and will disable jemalloc if option '${COMMAND_DISABLE_JEMALLOC}' given.\n" exit 0 @@ -171,4 +172,16 @@ elif [ "$1" = "$COMMAND_NATIVE_KUBERNETES" ]; then exec $(drop_privs_cmd) bash -c "${args[@]}" fi -exec "$@" +args=("${args[@]}") + +disable_jemalloc_env args + +copy_plugins_if_required + +# Set the Flink related environments +export _FLINK_HOME_DETERMINED=true +. $FLINK_HOME/bin/config.sh +export FLINK_CLASSPATH="`constructFlinkClassPath`:$INTERNAL_HADOOP_CLASSPATHS" + +echo "Running command in pass-through mode: ${args[@]}" +exec $(drop_privs_cmd) "${args[@]}" diff --git a/1.12/scala_2.12-java8-debian/docker-entrypoint.sh b/1.12/scala_2.12-java8-debian/docker-entrypoint.sh index 68db96b0..a83e2a21 100755 --- a/1.12/scala_2.12-java8-debian/docker-entrypoint.sh +++ b/1.12/scala_2.12-java8-debian/docker-entrypoint.sh @@ -19,6 +19,7 @@ ############################################################################### COMMAND_STANDALONE="standalone-job" +# Deprecated, should be remove in Flink release 1.13 COMMAND_NATIVE_KUBERNETES="native-k8s" COMMAND_HISTORY_SERVER="history-server" COMMAND_DISABLE_JEMALLOC="disable-jemalloc" @@ -108,7 +109,7 @@ disable_jemalloc_env() { args=("$@") if [ "$1" = "help" ]; then - printf "Usage: $(basename "$0") (jobmanager|${COMMAND_STANDALONE}|taskmanager|${COMMAND_NATIVE_KUBERNETES}|${COMMAND_HISTORY_SERVER}) [${COMMAND_DISABLE_JEMALLOC}]\n" + printf "Usage: $(basename "$0") (jobmanager|${COMMAND_STANDALONE}|taskmanager|${COMMAND_HISTORY_SERVER}) [${COMMAND_DISABLE_JEMALLOC}]\n" printf " Or $(basename "$0") help\n\n" printf "By default, Flink image adopts jemalloc as default memory allocator and will disable jemalloc if option '${COMMAND_DISABLE_JEMALLOC}' given.\n" exit 0 @@ -171,4 +172,16 @@ elif [ "$1" = "$COMMAND_NATIVE_KUBERNETES" ]; then exec $(drop_privs_cmd) bash -c "${args[@]}" fi -exec "$@" +args=("${args[@]}") + +disable_jemalloc_env args + +copy_plugins_if_required + +# Set the Flink related environments +export _FLINK_HOME_DETERMINED=true +. $FLINK_HOME/bin/config.sh +export FLINK_CLASSPATH="`constructFlinkClassPath`:$INTERNAL_HADOOP_CLASSPATHS" + +echo "Running command in pass-through mode: ${args[@]}" +exec $(drop_privs_cmd) "${args[@]}"