Skip to content
This repository was archived by the owner on Apr 4, 2026. It is now read-only.

Commit eb8a09c

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 eb8a09c

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

source/compose.manager/scripts/compose.sh

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,30 @@
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+
awk '{if (NR!=1) {print $1}}' |
17+
xargs -I {} find $DOCKER_IMAGES $UNRAID_IMAGES -name {}.png -delete
1218
docker compose -f "$2" -p "$3" up -d 2>&1
1319
;;
1420

1521
down)
1622
docker compose -f "$2" -p "$3" ps -a |
1723
awk '{if (NR!=1) {printf("%s.\"%s\"", sep, $1); sep=", "}}' |
1824
xargs -0 -I {} jq 'del({})' $DOCKER_JSON > $DOCKER_JSON
25+
docker compose -f "$2" -p "$3" ps -a |
26+
awk '{if (NR!=1) {print $1}}' |
27+
xargs -I {} find $DOCKER_IMAGES $UNRAID_IMAGES -name {}.png -delete
1928
docker compose -f "$2" -p "$3" down 2>&1
2029
;;
2130

0 commit comments

Comments
 (0)