forked from mtusi2026/mtusi2026lab5
lab5 na4
This commit is contained in:
Executable
+13
@@ -0,0 +1,13 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
: "${TARGET_INSTANCE_ID:?test provides target API instance alias}"
|
||||
|
||||
cid=""
|
||||
for id in $(docker compose ps -q api); do
|
||||
host=$(docker inspect -f '{{.Config.Hostname}}' "$id")
|
||||
if [ "$host" = "$TARGET_INSTANCE_ID" ]; then cid="$id"; break; fi
|
||||
done
|
||||
[ -n "$cid" ] || { echo "container for instance $TARGET_INSTANCE_ID not found" >&2; exit 1; }
|
||||
|
||||
docker stop -t 8 "$cid" >/dev/null
|
||||
echo "stopped $cid" >&2
|
||||
Reference in New Issue
Block a user