如何解决S6 overlay bash脚本命令替换警告:输入中的空字节被忽略
我有一个基于Alpine的docker容器,该容器运行一个使用外部数据库的AdonisJS程序。作为启动过程的一部分,我在cont-init.d目录中使用bash脚本检查数据库端点的有效性。脚本的相关部分是:
# check for the database endpoint for 30 seconds
echo " "
echo "**** Checking DB endpoint ****"
source .env
END=$((SECONDS+30))
while [ ${SECONDS} -lt ${END} ] && [ "${DB_HOST} ${DB_PORT}" ];
do
/usr/bin/nc -z ${DB_HOST} ${DB_PORT} && \
if [ ! -z "$(/usr/bin/nc -w1 ${DB_HOST} ${DB_PORT})" ];
then
[ ! -z "${RUN}" ] && break
RUN="RAN"
# we sleep here again due to first run init on DB containers
[ ! -f /dbwait.lock ] && sleep 5
else
sleep 1
fi
sleep 1
done
这似乎起作用,因为它检查以确保数据库可访问,然后继续进行。但是,我的docker日志中的输出是这样的:
**** Checking DB endpoint ****
/var/run/s6/etc/cont-init.d/50-config: line 136: warning: command substitution: ignored null byte in input
/var/run/s6/etc/cont-init.d/50-config: line 136: warning: command substitution: ignored null byte in input
我该如何解决导致此警告的原因或至少抑制该消息?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。