fix: download Docker from URL, not apt (works offline/air-gapped)

- DOCKER_DOWNLOAD_URL and WALLARM_IMAGE_URL env vars for custom sources
- Falls back to offline/ dir if present
- Docker installed under /opt/fw/docker/bin/
This commit is contained in:
admin 2026-08-03 14:38:59 +00:00
parent 587aa70554
commit 128e59c0e4

View file

@ -48,20 +48,20 @@ echo -e "${GREEN}Python: $($PYTHON_BIN --version)${NC}"
# ── 4. Install Docker under /opt/fw/docker/ ───────────────────────────
DOCKER_DIR="${WALLARM_DIR}/docker"
DOCKER_URL="${DOCKER_DOWNLOAD_URL:-https://download.docker.com/linux/static/stable/x86_64/docker-29.2.1.tgz}"
WALLARM_IMAGE_URL="${WALLARM_IMAGE_URL:-https://git.sechpoint.app/customer-engineering/wallarm/releases/download/v1.0.0/wallarm-node-6.11.0-rc1.tar.gz}"
if ! command -v docker >/dev/null 2>&1; then
echo -e "${YELLOW}Installing Docker under ${DOCKER_DIR}...${NC}"
echo -e "${YELLOW}Downloading Docker...${NC}"
mkdir -p "${DOCKER_DIR}/bin" "${DOCKER_DIR}/data"
if [ -f "${OFFLINE_DIR}/docker-29.2.1.tgz" ]; then
echo -e "${GREEN} Using offline binary${NC}"
tar -xzf "${OFFLINE_DIR}/docker-29.2.1.tgz" -C "${DOCKER_DIR}/bin/"
elif command -v apt-get >/dev/null 2>&1; then
apt-get install -y -qq docker.io 2>/dev/null
cp /usr/bin/docker* "${DOCKER_DIR}/bin/" 2>/dev/null || true
cp /usr/bin/dockerd* "${DOCKER_DIR}/bin/" 2>/dev/null || true
elif command -v yum >/dev/null 2>&1; then
yum install -y -q docker 2>/dev/null
cp /usr/bin/docker* "${DOCKER_DIR}/bin/" 2>/dev/null || true
else
curl -fsSL "${DOCKER_URL}" -o /tmp/docker.tgz 2>/dev/null && \
tar -xzf /tmp/docker.tgz -C "${DOCKER_DIR}/bin/" && \
rm -f /tmp/docker.tgz
fi
# Start dockerd with custom data root