forked from mtusi2026/mtusi2026lab7
Implement Lab 7 security and infrastructure
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
: "${TARGET_INSTANCE_ID:?test must provide the API instance id}"
|
||||
found=""
|
||||
for container in $(docker compose ps -q api); do
|
||||
hostname=$(docker inspect --format '{{.Config.Hostname}}' "$container")
|
||||
if [ "$hostname" = "$TARGET_INSTANCE_ID" ]; then
|
||||
found="$container"
|
||||
break
|
||||
fi
|
||||
done
|
||||
if [ -z "$found" ]; then
|
||||
echo "No API container matched TARGET_INSTANCE_ID" >&2
|
||||
exit 1
|
||||
fi
|
||||
docker stop "$found" >/dev/null
|
||||
Reference in New Issue
Block a user