-
Notifications
You must be signed in to change notification settings - Fork 1
/
clearIGC.sh
45 lines (39 loc) · 1.14 KB
/
clearIGC.sh
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
37
38
39
40
41
42
43
44
45
#!/bin/bash
#Image associated with the running container
echo
echo 'Checking for the running IGC containers...'
echo
runningContainerImage=$(docker ps -a | grep "igsDocker" | awk '{ print $2 }');
#Removing the running IGC container
if [ ! -z "$runningContainerImage" -a "$runningContainerImage"!=" " ]
then
echo 'Image associated with the running container: '$runningContainerImage;
echo
echo '----- Removing the running IGC container ------';
docker rm -f 'igsDocker';
echo '----- Removing the IGC image associated with the container ------';
docker rmi -f $runningContainerImage;
echo
else
echo 'No IGC container is running...'
fi
echo
echo 'Checking for the old IGC images...'
echo
oldImages=$(docker images | grep "app_integrate" | awk '{ print $3 }');
if [ ! -z "$oldImages" -a "$oldImages"!=" " ]
then
docker rmi -f $oldImages;
fi
oldImages=$(docker images | grep "ibm_igc" | awk '{ print $3 }');
if [ ! -z "$oldImages" -a "$oldImages"!=" " ]
then
docker rmi -f $oldImages;
fi
oldImages=$(docker images | grep "igc_image" | awk '{ print $3 }');
if [ ! -z "$oldImages" -a "$oldImages"!=" " ]
then
docker rmi -f $oldImages;
fi
echo
echo 'DONE'