694480f2ae
ci/woodpecker/push/woodpecker Pipeline was successful
- Replace LOG_D calls with debug() function - Replace LOG_I calls with info() function - Maintain echo() in build-time overrides script - Fix 'command not found' errors for LOG_I function - Ensure consistent logging format across all runtime scripts Modified files: - customer/usr/local/bin/common.sh: 4 LOG_D -> debug calls - customer/usr/local/bin/setup.sh: 3 LOG_I -> info, 1 LOG_D -> debug calls - customer/usr/local/bin/run.sh: 2 LOG_I -> info calls - customer/usr/local/bin/entry.sh: already using info() calls (no changes needed)
31 lines
1.2 KiB
Bash
Executable File
31 lines
1.2 KiB
Bash
Executable File
#!/usr/bin/dumb-init /bin/bash
|
||
# Ver: 1.5 by Endial Fang (endial@126.com)
|
||
#
|
||
# 容器入口脚本;当前脚本执行完毕时,使用默认用户执行镜像 CMD 定义的命令(默认为'/usr/local/bin/run.sh')
|
||
|
||
# 设置 shell 执行参数,可使用'-'(打开)'+'(关闭)控制。常用:
|
||
# -e: 命令执行错误则报错(errexit); -u: 变量未定义则报错(nounset); -x: 打印实际待执行的命令行; -o pipefail: 设置管道中命令遇到失败则报错
|
||
set -euo pipefail
|
||
|
||
. /usr/local/lib/libcommon.sh # 加载通用函数库
|
||
|
||
. /usr/local/bin/environment.sh # 设置环境变量
|
||
|
||
info "** Processing entry.sh **"
|
||
|
||
# 优先处理'-'开始的版本信息、帮助信息显示命令,如果是该类命令,处理后退出容器
|
||
[[ "${1:0:1}" == '-' ]] && set -- "${APP_EXEC:-/bin/bash}" "$@" && print_command_help "$@"
|
||
|
||
# 处理 root 用户**且**使用默认启动脚本时的初始化
|
||
if [[ "$(id -u)" == '0' ]] && [[ "$1" == "run.sh" ]]; then
|
||
print_welcome_info
|
||
/usr/local/bin/setup.sh
|
||
|
||
# 执行应用启动脚本并替换当前进程
|
||
exec gosu "${APP_USER}" "$@"
|
||
fi
|
||
|
||
# 处理非以上情形的自定义命令
|
||
info "Start container with command: $@"
|
||
exec "$@"
|