fixed redeploy script
This commit is contained in:
6
redeploy
6
redeploy
@@ -14,9 +14,9 @@ log 'Stopping stack'
|
|||||||
docker compose down
|
docker compose down
|
||||||
|
|
||||||
log 'Removing current local compose image(s)'
|
log 'Removing current local compose image(s)'
|
||||||
IMAGE_IDS="$(docker compose images -q | sort -u | tr '\n' ' ' | xargs)"
|
mapfile -t IMAGE_NAMES < <(docker compose config --images 2>/dev/null | sed '/^$/d' | sort -u)
|
||||||
if [[ -n "$IMAGE_IDS" ]]; then
|
if [[ "${#IMAGE_NAMES[@]}" -gt 0 ]]; then
|
||||||
docker image rm -f $IMAGE_IDS
|
docker image rm -f "${IMAGE_NAMES[@]}" || true
|
||||||
else
|
else
|
||||||
log 'No compose-managed local images found to remove.'
|
log 'No compose-managed local images found to remove.'
|
||||||
fi
|
fi
|
||||||
|
|||||||
Reference in New Issue
Block a user