mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-11 18:26:50 +00:00
24 lines
587 B
Bash
Executable File
24 lines
587 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# This script destroys all Docker containers but leaves the Docker images alone.
|
|
|
|
echo '------------------------------------------'
|
|
echo 'Killing and removing all Docker containers'
|
|
|
|
for i in $(docker ps -a -q)
|
|
do
|
|
echo "Evaluating $(docker inspect --format='{{ .Name }}' $i)"
|
|
if [[ $(docker inspect --format='{{ .Name }}' $i) =~ "openfoodnetwork" ]]
|
|
then
|
|
echo "Deleting OFN container: $i"
|
|
docker kill $i; wait;
|
|
docker rm -f $i; wait;
|
|
else
|
|
echo 'Ignoring container not related to OFN'
|
|
fi
|
|
done;
|
|
|
|
echo '------------'
|
|
echo 'docker ps -a'
|
|
docker ps -a
|