From b7aaf88718aecfe67ea72bc05f6190df05d170b6 Mon Sep 17 00:00:00 2001 From: Chia-Ping Tsai Date: Sun, 19 Jan 2025 01:29:10 +0800 Subject: [PATCH] [DOCKER] align the way of feching ip address --- docker/docker_build_common.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/docker_build_common.sh b/docker/docker_build_common.sh index c388cf24ac..73fe608240 100644 --- a/docker/docker_build_common.sh +++ b/docker/docker_build_common.sh @@ -17,7 +17,7 @@ declare -r USER=astraea declare -r BUILD=${BUILD:-false} declare -r RUN=${RUN:-true} -declare -r ADDRESS=$([[ "$(which ipconfig)" != "" ]] && ipconfig getifaddr en0 || hostname -i | awk '{print $1}') +declare -r ADDRESS=$(ip -o -4 address show | awk ' NR==2 { gsub(/\/.*/, "", $4); print $4 } ') # ===================================[functions]===================================