Skip to content

Commit 8d884be

Browse files
committed
Add feature to remove cached icons when spinning down project
The changes in this commit ensures that cached icons are removed from the server so that changes made to the `net.unraid.docker.icon` are respected.
1 parent 276f8b2 commit 8d884be

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

source/compose.manager/scripts/compose.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,28 @@
11
#!/bin/bash
22

33
export HOME=/root
4-
export DOCKER_JSON=/usr/local/emhttp/state/plugins/dynamix.docker.manager/docker.json
4+
DOCKER_MANAGER=/usr/local/emhttp/state/plugins/dynamix.docker.manager
5+
DOCKER_JSON=$DOCKER_MANAGER/docker.json
6+
DOCKER_IMAGES=$DOCKER_MANAGER/images
7+
UNRAID_IMAGES=/var/lib/docker/unraid/images
58

69
case $1 in
710

811
up)
912
docker compose -f "$2" -p "$3" ps -a |
1013
awk '{if (NR!=1) {printf("%s.\"%s\"", sep, $1); sep=", "}}' |
1114
xargs -0 -I {} jq 'del({})' $DOCKER_JSON > $DOCKER_JSON
15+
docker compose -f "$2" -p "$3" ps -a |
16+
xargs -I {} find $DOCKER_IMAGES $UNRAID_IMAGES -name {}.png -delete
1217
docker compose -f "$2" -p "$3" up -d 2>&1
1318
;;
1419

1520
down)
1621
docker compose -f "$2" -p "$3" ps -a |
1722
awk '{if (NR!=1) {printf("%s.\"%s\"", sep, $1); sep=", "}}' |
1823
xargs -0 -I {} jq 'del({})' $DOCKER_JSON > $DOCKER_JSON
24+
docker compose -f "$2" -p "$3" ps -a |
25+
xargs -I {} find $DOCKER_IMAGES $UNRAID_IMAGES -name {}.png -delete
1926
docker compose -f "$2" -p "$3" down 2>&1
2027
;;
2128

0 commit comments

Comments
 (0)