Skip to content

Commit

Permalink
handle multiple host ip gracefully (#59)
Browse files Browse the repository at this point in the history
I don't know why but i have multiple default routes in my container.
  • Loading branch information
Buck Evan authored Nov 10, 2023
1 parent c046878 commit 04ef11f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ else
# If none hostname resolves, then we try using the default gateway address
if [ ! "$docker_host_ip" ]; then
docker_host_source="default gateway"
docker_host_ip="$(ip -4 route show default | cut -d' ' -f3)"
docker_host_ip="$(ip -4 route show default | cut -d' ' -f3 | head -n1)"
fi

if [ ! "$docker_host_ip" ]
Expand Down

0 comments on commit 04ef11f

Please sign in to comment.