Mercurial > public > ssdt-docker
diff scripts/.functions.sh @ 284:d41836720ce4 production v2.3.0
flow: Merged <release> 'v2.3.0' to <master> ('production').
author | smith@nwoca.org |
---|---|
date | Thu, 15 Nov 2018 20:10:48 +0000 |
parents | d6d8468441b1 |
children |
line wrap: on
line diff
--- a/scripts/.functions.sh Wed Nov 14 22:05:33 2018 +0000 +++ b/scripts/.functions.sh Thu Nov 15 20:10:48 2018 +0000 @@ -34,7 +34,7 @@ # finds docker container for specified compose service composeGetContainer() { service=${1?"Must supply service from current project"} - container=$( docker-compose ps | cut -d " " -f 1 -s | grep _${service}_ ) + container=$( docker-compose ps -q $service | xargs docker inspect -f '{{.Name}}' | cut -d "/" -f 2 ) echo $container } @@ -46,6 +46,6 @@ } composeGetProject() { - project=$( docker-compose ps | tail -n1 | cut -d "_" -f 1 -s ) + project=$(docker-compose ps -q | tail -n1 | xargs docker inspect -f "{{ index .Config.Labels \"com.docker.compose.project\"}}" ) echo $project }