1 Star 0 Fork 3

Rukiy/alpine-openjdk17

forked from Rukiy/alpine-openjdk11 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
entrypoint.sh 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
Rukiy 提交于 2019-10-08 02:22 . 初始化文件
#!/bin/sh
set -e
# In case the user wants only to use java with options
if [ $# -gt 0 ]
then
exec java $@
exit 0
fi
# Behavior when using the /app folder
#
# In the setenv.sh file you may define the following environment
# variables
#
# JAVA_OPTS : a string containing the list of java options to
# pass to the java command.
# eg. JAVA_OPTS="-Xmx1g -Dfile.encoding=utf8"
# APP_ARGS
SETENV_FILE=/app/config/Environment.sh
if [ -r $SETENV_FILE ]
then
source $SETENV_FILE
fi
TMP_JARS_LIST=/tmp/jars_list
find /app -maxdepth 1 -regex '.*.[jw]ar$' > $TMP_JARS_LIST
nb_jars=$(cat $TMP_JARS_LIST | wc -l)
if [ $nb_jars -gt 1 ]
then
echo 'ERROR: You may only have one jar in the /app folder'
echo '==================================================='
cat $TMP_JARS_LIST
exit 1
elif [ $nb_jars -eq 0 ]
then
echo 'ERROR: There should be one and only one jar in the /app folder'
echo '=============================================================='
exit 1
else
CMD="java $JAVA_OPTS -jar $(cat $TMP_JARS_LIST) $APP_ARGS"
echo "Launching the following command:"
echo " |"
echo ' `-> '"$CMD"
echo
exec $CMD
fi
exit 0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Docker
1
https://gitee.com/rukiy/alpine-openjdk17.git
git@gitee.com:rukiy/alpine-openjdk17.git
rukiy
alpine-openjdk17
alpine-openjdk17
master

搜索帮助