File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/sh
2
2
3
- set -e
4
-
5
3
TF_TAG=" tinyFaaS"
6
4
TMP_DIR=" tmp"
7
5
8
6
# remove old containers, networks and images
9
7
containers=$( docker ps -a -q --filter label=$TF_TAG )
10
8
11
9
if [ -n " $containers " ]; then
12
- docker stop " $containers " > /dev/null
13
- docker rm " $containers " > /dev/null
10
+ for container in $containers ; do
11
+ docker stop " $container " > /dev/null || echo " Failed to stop container $container ! Please stop it manually..."
12
+ docker rm " $container " > /dev/null || echo " Failed to remove container $container ! Please remove it manually..."
13
+ done
14
14
else
15
15
echo " No old containers to remove. Skipping..."
16
16
fi
17
17
18
18
networks=$( docker network ls -q --filter label=$TF_TAG )
19
19
20
20
if [ -n " $networks " ]; then
21
- docker network rm " $networks " > /dev/null
21
+ for network in $networks ; do
22
+ docker network rm " $network " > /dev/null || echo " Failed to remove network $network ! Please remove it manually..."
23
+ done
22
24
else
23
25
echo " No old networks to remove. Skipping..."
24
26
fi
@@ -27,17 +29,15 @@ images=$(docker image ls -q --filter label=$TF_TAG)
27
29
28
30
if [ -n " $images " ]; then
29
31
for image in $images ; do
30
- docker image rm " $image " > /dev/null
32
+ docker image rm " $image " > /dev/null || echo " Failed to remove image $image ! Please remove it manually... "
31
33
done
32
34
else
33
35
echo " No old images to remove. Skipping..."
34
36
fi
35
37
36
38
# remove tmp directory
37
39
if [ -d " $TMP_DIR " ]; then
38
- rm -rf " $TMP_DIR "
40
+ rm -rf " $TMP_DIR " > /dev/null || echo " Failed to remove directory $TMP_DIR ! Please remove it manually... "
39
41
else
40
42
echo " No tmp directory to remove. Skipping..."
41
43
fi
42
-
43
- set +e
You can’t perform that action at this time.
0 commit comments