./share/scripts/ip in docker-utils-0.1.35 vs ./share/scripts/ip in docker-utils-0.1.37
- old
+ new
@@ -7,16 +7,18 @@
container_name="$1"; shift
container_ip_addr=""
+sleep_interval='0.1'
if [ "${mode}" = "wait" ]; then
while :; do
container_ip_addr=$(command docker inspect --format '{{.NetworkSettings.IPAddress}}' "${container_name}" 2>/dev/null)
if [ -n "${container_ip_addr}" ]; then
break
fi
- sleep 0.1
+ sleep "${sleep_interval}"
+ sleep_interval=$(echo "((${sleep_interval} * 2) % 10) + 0.1" | bc)
done
else
container_ip_addr=$(command docker inspect --format '{{.NetworkSettings.IPAddress}}' "${container_name}" 2>/dev/null)
fi