Browse Source

fix: get only running container for service of given project for =get_running_containers_for_service=

cache-relation
Valentin Lab 2 years ago
parent
commit
15862fe3a8
  1. 14
      bin/compose-core

14
bin/compose-core

@ -1013,9 +1013,19 @@ export -f docker_add_host_declaration
get_running_containers_for_service() {
local service="$1"
local service="$1" project="$2"
project=${project:-$PROJECT_NAME}
[ -n "$project" ] || {
err "No project name was defined yet."
return 1
}
docker ps --filter label="compose.master-service=$service" --format="{{.ID}}"
docker ps \
--filter label="compose.project=$project" \
--filter label="compose.master-service=$service" \
--format="{{.ID}}"
}
export -f get_running_containers_for_service

Loading…
Cancel
Save