From 5c646456481e681b5c33cea2ce6058fadb0bb155 Mon Sep 17 00:00:00 2001 From: Valentin Lab Date: Mon, 26 Nov 2018 12:16:54 +0100 Subject: [PATCH] fix: ``wait_for_tcp_port`` would not work as expected and always succeed. ``$DEFAULT_BASH_IMAGE`` would not be set (because not exported) and as consequence the ``docker run`` would fail with an errorlevel different from 1. The failure condition was bogus here, and we should not rely on ``$DEFAULT_BASH_IMAGE`` to be exported. Both have been corrected. --- bin/compose-core | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bin/compose-core b/bin/compose-core index 588a222..2f417df 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -695,11 +695,12 @@ wait_docker_ip() { } export -f wait_docker_ip -DEFAULT_BASH_IMAGE=${DEFAULT_BASH_IMAGE:-docker.0k.io/bash} wait_for_tcp_port() { local network=$1 host_port=$2 timeout=20 verb "Trying to connect to $host_port" - docker run --rm -i --network "$network" "$DEFAULT_BASH_IMAGE" <&2 + docker run --rm -i --network "$network" "$bash_image" </dev/null 2>&1 && break