From b53c6b3d4a54da826721b8c2b765406a3128eebf Mon Sep 17 00:00:00 2001 From: Aykhan Shahsuvarov Date: Mon, 13 Jul 2026 14:33:06 +0400 Subject: [PATCH] preflight: ensure ~/.docker/config.json is a file (watchtower mount) --- main.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/main.sh b/main.sh index 0b4c2c9..7efc395 100755 --- a/main.sh +++ b/main.sh @@ -88,6 +88,13 @@ fix_permissions() { start_services() { fix_permissions + # Ensure ~/.docker/config.json is a FILE before any container mounts it. + # watchtower bind-mounts it; if it is missing, the Docker daemon creates it + # as a root-owned directory, which then breaks every docker CLI call. + mkdir -p ~/.docker + [ -d ~/.docker/config.json ] && sudo rmdir ~/.docker/config.json + [ -f ~/.docker/config.json ] || echo '{}' > ~/.docker/config.json + docker network create caddy 2>/dev/null docker network create grafana 2>/dev/null docker network create gitea 2>/dev/null