Merge pull request #1535 from casperklein/patch-2

Improve container/image name detection
This commit is contained in:
Erik Wramner 2020-06-14 20:10:51 +02:00 committed by GitHub
commit 3ce36407b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -27,11 +27,12 @@ fi
INFO=$($CRI ps \
--no-trunc \
--format="{{.Image}} {{.Names}} {{.Command}}" | \
grep "supervisord -c /etc/supervisor/supervisord.conf")
--format "{{.Image}};{{.Names}}" \
--filter label=org.label-schema.name="docker-mailserver" | \
tail -1)
IMAGE_NAME=$(echo $INFO | awk '{print $1}')
CONTAINER_NAME=$(echo $INFO | awk '{print $2}')
IMAGE_NAME=${INFO%;*}
CONTAINER_NAME=${INFO#*;}
DEFAULT_CONFIG_PATH="$(pwd)/config"
USE_CONTAINER=false