1
0
Fork 0
mirror of synced 2024-07-07 07:15:43 +12:00
budibase/scripts/killTestcontainers.sh

19 lines
511 B
Bash
Executable file

#!/bin/bash
# Find all Docker containers with the label "org.testcontainers=true"
containers=$(docker ps -q -f "label=org.testcontainers=true")
# Check if there are any containers to stop
if [ -z "$containers" ]; then
echo "No containers with label 'org.testcontainers=true' found."
else
# Stop the containers
echo "Stopping containers..."
docker stop $containers
# Remove the containers
echo "Removing containers..."
docker rm $containers
echo "Containers have been stopped and removed."
fi