Skip to content

Commit 04ef11f

Browse files
author
Buck Evan
authored
handle multiple host ip gracefully (#59)
I don't know why but i have multiple default routes in my container.
1 parent c046878 commit 04ef11f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ else
5151
# If none hostname resolves, then we try using the default gateway address
5252
if [ ! "$docker_host_ip" ]; then
5353
docker_host_source="default gateway"
54-
docker_host_ip="$(ip -4 route show default | cut -d' ' -f3)"
54+
docker_host_ip="$(ip -4 route show default | cut -d' ' -f3 | head -n1)"
5555
fi
5656

5757
if [ ! "$docker_host_ip" ]

0 commit comments

Comments
 (0)