-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.bat
More file actions
40 lines (34 loc) · 997 Bytes
/
run.bat
File metadata and controls
40 lines (34 loc) · 997 Bytes
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
@echo off
REM Get the port number from the command line
IF "%~1"=="" (
set "PORT=0"
) ELSE (
set "PORT=%~1"
)
REM Get the image name from the file
set /p IMAGE=<.docker/image_name
REM Check if the image is already available, and pull if needed
docker image inspect %IMAGE% >nul 2>&1
IF %ERRORLEVEL% NEQ 0 (
echo Image not found locally. Pulling %IMAGE%...
docker pull %IMAGE%
IF %ERRORLEVEL% NEQ 0 (
echo Failed to pull image %IMAGE%.
exit /b 1
)
echo:
echo:
echo:
)
REM Copy the run script from the image
FOR /F %%i IN ('docker create %IMAGE%') DO SET CID=%%i
docker cp %CID%:/interface.ps1 .interface.ps1 >nul
docker rm -v %CID% >nul
REM Run the image's interface script
REM powershell -ExecutionPolicy Bypass -File .interface.ps1 %IMAGE%
IF %PORT% NEQ 0 (
powershell -ExecutionPolicy Bypass -File .interface.ps1 -image %IMAGE% -port %PORT%
) ELSE (
powershell -ExecutionPolicy Bypass -File .interface.ps1 -image %IMAGE%
)
pause