diff --git a/bin/compose-core b/bin/compose-core index d9ab164..101c737 100755 --- a/bin/compose-core +++ b/bin/compose-core @@ -4289,6 +4289,12 @@ get_healthy_container_ip_for_service () { return 1 fi + if [ "$(echo "$containers" | wc -l)" -gt 1 ]; then + err "More than 1 container running for service $DARKYELLOW$SERVICE_NAME$NORMAL." + echo " Please contact administrator to fix this issue." >&2 + return 1 + fi + ## XXXvlab: taking first container is probably not a good idea container="$(echo "$containers" | head -n 1)"