-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.bat
More file actions
28 lines (22 loc) · 700 Bytes
/
Copy pathrun.bat
File metadata and controls
28 lines (22 loc) · 700 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
@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=<.podman/image_name
podman build -t %IMAGE% .
REM Copy the run script from the image
FOR /F %%i IN ('podman create %IMAGE%') DO SET CID=%%i
podman cp %CID%:/.podman/interface.ps1 .interface.ps1 >nul
podman 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