Commit e2e5c40 1 parent b489210 commit e2e5c40 Copy full SHA for e2e5c40
File tree 1 file changed +28
-0
lines changed
1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 60
60
npm install
61
61
62
62
IMAGE="kevinthedang/discord-ollama"
63
+ REDIS="redis"
64
+ OLLAMA="ollama/ollama"
63
65
64
66
if docker images | grep -q $IMAGE; then
65
67
IMAGE_ID=$(docker images -q $IMAGE)
74
76
echo "Old $IMAGE Image Removed"
75
77
fi
76
78
79
+ if docker images | grep -q $REDIS; then
80
+ IMAGE_ID=$(docker images -q $REDIS)
81
+ CONTAINER_IDS=$(docker ps -q --filter "ancestor=$IMAGE_ID")
82
+
83
+ if [ ! -z "$CONTAINER_IDS" ]; then
84
+ # Stop and remove the running containers
85
+ docker stop $CONTAINER_IDS
86
+ echo "Stopped and removed the containers using the image $REDIS"
87
+ fi
88
+ docker rmi $IMAGE_ID
89
+ echo "Old $REDIS Image Removed"
90
+ fi
91
+
92
+ if docker images | grep -q $OLLAMA; then
93
+ IMAGE_ID=$(docker images -q $OLLAMA)
94
+ CONTAINER_IDS=$(docker ps -q --filter "ancestor=$IMAGE_ID")
95
+
96
+ if [ ! -z "$CONTAINER_IDS" ]; then
97
+ # Stop and remove the running containers
98
+ docker stop $CONTAINER_IDS
99
+ echo "Stopped and removed the containers using the image $OLLAMA"
100
+ fi
101
+ docker rmi $IMAGE_ID
102
+ echo "Old $OLLAMA Image Removed"
103
+ fi
104
+
77
105
docker network prune -f
78
106
docker system prune -a
79
107
You can’t perform that action at this time.
0 commit comments