From fd641905e042f86ad50c485a70077a9a7ea2c3e0 Mon Sep 17 00:00:00 2001 From: admin Date: Mon, 3 Aug 2026 14:25:19 +0000 Subject: [PATCH] =?UTF-8?q?feat:=20offline=20mode=20=E2=80=94=20pre-downlo?= =?UTF-8?q?ad=20Docker=20+=20Wallarm=20image=20to=20/opt/fw/offline/?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- setup.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/setup.sh b/setup.sh index ce743e7..f50efd8 100644 --- a/setup.sh +++ b/setup.sh @@ -71,7 +71,13 @@ chmod +x "${APP_DIR}/main.py" "${WALLARM_DIR}/deploy.sh" # ── Install Docker (for container-based deployment) ────────────────── if ! command -v docker >/dev/null 2>&1; then echo -e "${YELLOW}Installing Docker...${NC}" - if command -v apt-get >/dev/null 2>&1; then + # Check for offline Docker binary first + if [ -f "${WALLARM_DIR}/offline/docker-29.2.1.tgz" ]; then + echo -e "${YELLOW} Using offline Docker binary...${NC}" + tar -xzf "${WALLARM_DIR}/offline/docker-29.2.1.tgz" -C /usr/local/bin/ + dockerd & + sleep 2 + elif command -v apt-get >/dev/null 2>&1; then apt-get install -y -qq docker.io 2>/dev/null elif command -v yum >/dev/null 2>&1; then yum install -y -q docker 2>/dev/null @@ -82,6 +88,12 @@ if ! command -v docker >/dev/null 2>&1; then systemctl start docker 2>/dev/null || true fi +# ── Pre-cache Wallarm Docker image if offline file exists ───────────── +if [ -f "${WALLARM_DIR}/offline/wallarm-node-6.13.0.tar" ]; then + echo -e "${YELLOW}Loading offline Wallarm image...${NC}" + docker load -i "${WALLARM_DIR}/offline/wallarm-node-6.13.0.tar" 2>/dev/null || true +fi + echo echo -e "${GREEN}${BOLD}Ready!${NC}" echo -e " ${GREEN}sudo /opt/fw/deploy.sh${NC}"