yurtaev - lab4

This commit is contained in:
yurtaev.va
2026-11-06 15:43:25 +03:00
parent ec540a1a72
commit 2a88f717f3
22 changed files with 1627 additions and 42 deletions
+12
View File
@@ -0,0 +1,12 @@
#!/bin/sh
set -eu
: "${TARGET_INSTANCE_ID:?TARGET_INSTANCE_ID is required}"
case "$TARGET_INSTANCE_ID" in
*[!a-fA-F0-9]*|'') echo "Invalid instance id" >&2; exit 2 ;;
esac
service=$(docker inspect --format '{{ index .Config.Labels "com.docker.compose.service" }}' "$TARGET_INSTANCE_ID")
if [ "$service" != api ]; then
echo "Target is not a Compose API replica" >&2
exit 2
fi
docker stop -t 1 "$TARGET_INSTANCE_ID" >/dev/null