libreoffice-micro/docker-entrypoint.sh
2026-04-30 19:25:59 +08:00

17 lines
553 B
Bash
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/sh
# 若外部已通过 -e 传入 DUBBO_IP_TO_REGISTRY 则直接使用,
# 否则自动取容器第一个 IP适用于全容器部署场景
if [ -z "$DUBBO_IP_TO_REGISTRY" ]; then
CONTAINER_IP=$(hostname -I | awk '{print $1}')
if [ -z "$CONTAINER_IP" ]; then
echo "警告: 无法获取容器 IP使用默认自动探测"
else
export DUBBO_IP_TO_REGISTRY=$CONTAINER_IP
echo "注册 IP (自动): $DUBBO_IP_TO_REGISTRY"
fi
else
echo "注册 IP (外部指定): $DUBBO_IP_TO_REGISTRY"
fi
exec "$@"