Files
mtusi2026lab4/scripts/stop-one.sh
T
2026-10-31 11:54:18 +03:00

9 lines
315 B
Bash
Executable File

#!/bin/sh
set -eu
: "${TARGET_INSTANCE_ID:?test provides target API instance alias}"
service=$(docker inspect -f '{{index .Config.Labels "com.docker.compose.service"}}' "$TARGET_INSTANCE_ID")
[ "$service" = "api" ] || { echo "not an api container" >&2; exit 1; }
docker stop -t 5 "$TARGET_INSTANCE_ID" >/dev/null