Repository navigation
8000
div>
Expand file tree
/
Copy pathnuke
More file actions
executable file
·36 lines (28 loc) · 815 Bytes
/
Copy pathnuke
File metadata and controls
executable file
·36 lines (28 loc) · 815 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/bash
# This script destroys all Docker containers, images, and networks.
# SOURCE: https://gist.github.com/JeffBelback/5687bb02f3618965ca8f
docker/nukec
echo '-----------------------'
echo 'docker network prune -f'
docker network prune -f
echo '--------------------------------------'
echo 'Killing and removing all Docker images'
for i in $(docker images -a -q)
do
echo "Evaluating $(docker image inspect --format='{{ .RepoTags }}' $i)"
if [[ $(docker image inspect --format='{{ .RepoTags }}' $i) =~ "openfoodnetwork" ]]
then
echo "Deleting $i"
docker kill $i; wait;
docker rmi -f $i; wait;
else
echo 'Ignoring container not related to OFN'
fi
done;
echo '------------'
echo 'docker ps -a'
docker ps -a
echo '----------------'
echo 'docker images -a'
docker images -a
wait