Files
umbrel-apps/sv2-ui/hooks/pre-start
2026-06-11 20:24:42 +10:00

17 lines
546 B
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
APP_DATA_DIR="$(readlink -f $(dirname "${BASH_SOURCE[0]}")/..)/data"
DOCKER_DIR="${APP_DATA_DIR}/docker"
# Remove stale Docker-in-Docker runtime state that can survive power loss,
# crashes, restarts, or updates and prevent the nested Docker daemon from
# starting.
#
# Keep ${DOCKER_DIR}/data intact. It is the nested Docker graph root and contains
# sv2-ui's inner containers, images, networks, and volumes.
rm -f "${DOCKER_DIR}/docker.pid"
rm -f "${DOCKER_DIR}/docker.sock"
rm -rf "${DOCKER_DIR}/exec"