From 29406ff34d988dc304cfdaa5474eb7bd70e19e0a Mon Sep 17 00:00:00 2001 From: Casper Date: Fri, 12 Jun 2020 18:52:32 +0200 Subject: [PATCH] Return only one result, if there are multiple matches Among other things, this is the case, when running tests with multiple containers. --- setup.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index 6913e86e..1dfd612d 100755 --- a/setup.sh +++ b/setup.sh @@ -25,7 +25,7 @@ if [ -z "$CRI" ]; then fi fi -INFO=$($CRI ps --no-trunc --format "{{.Image}};{{.Names}}" --filter label=org.label-schema.name="docker-mailserver") +INFO=$($CRI ps --no-trunc --format "{{.Image}};{{.Names}}" --filter label=org.label-schema.name="docker-mailserver" | tail -1) IMAGE_NAME=${INFO%;*} CONTAINER_NAME=${INFO#*;}