-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun_cli_container.bat
More file actions
57 lines (43 loc) · 1.52 KB
/
Copy pathrun_cli_container.bat
File metadata and controls
57 lines (43 loc) · 1.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
@echo off
setlocal EnableExtensions
REM ---------------------------------------------------------------------------
REM run_cli_container.bat
REM Build and run the vecnode CLI container in interactive mode.
REM ---------------------------------------------------------------------------
for %%I in ("%~dp0..\..") do set "REPO_ROOT=%%~fI"
set "DOCKERFILE_PATH=%REPO_ROOT%\docker\Dockerfile"
set "BUILD_CONTEXT=%REPO_ROOT%"
set "IMAGE_NAME=vecnode-cli:latest"
set "CONTAINER_NAME=vecnode-cli-session"
echo [INFO] Repository root: %REPO_ROOT%
echo [INFO] Dockerfile: %DOCKERFILE_PATH%
echo [INFO] Build context: %BUILD_CONTEXT%
echo [INFO] Image: %IMAGE_NAME%
echo.
where docker >nul 2>nul
if errorlevel 1 (
echo [ERROR] Docker is not available or not in PATH
exit /b 1
)
docker info >nul 2>nul
if errorlevel 1 (
echo [ERROR] Docker daemon is not running
exit /b 1
)
if not exist "%DOCKERFILE_PATH%" (
echo [ERROR] Dockerfile not found: %DOCKERFILE_PATH%
exit /b 1
)
echo [INFO] Building image...
docker build -t %IMAGE_NAME% -f "%DOCKERFILE_PATH%" "%BUILD_CONTEXT%"
if errorlevel 1 exit /b 1
echo.
echo [INFO] Starting container in interactive mode...
echo [INFO] Container name: %CONTAINER_NAME%
echo [INFO] Opening shell: /bin/bash
echo [INFO] Tools CLI command: bash /app/scripts/tools-cli/alpine/main.sh
echo [INFO] vecnode CLI command: bash /app/scripts/ubuntu22/main.sh
echo.
docker rm -f %CONTAINER_NAME% >nul 2>nul
docker run --rm -it --name %CONTAINER_NAME% --entrypoint /bin/bash %IMAGE_NAME%
exit /b %errorlevel%