forked from mtusi2026/mtusi2026lab3
1
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
@echo off
|
||||
if "%TARGET_INSTANCE_ID%"=="" (
|
||||
echo TARGET_INSTANCE_ID is not set
|
||||
exit /b 1
|
||||
)
|
||||
|
||||
for /f "tokens=*" %%i in ('docker ps -q --filter "name=lab3-api"') do (
|
||||
for /f "tokens=*" %%h in ('docker inspect -f "{{.Config.Hostname}}" %%i') do (
|
||||
if "%%h"=="%TARGET_INSTANCE_ID%" (
|
||||
echo Stopping container %%i
|
||||
docker stop %%i
|
||||
exit /b 0
|
||||
)
|
||||
)
|
||||
)
|
||||
echo Container not found
|
||||
exit /b 1
|
||||
Regular → Executable
Reference in New Issue
Block a user