forked from mtusi2026/mtusi2026lab4
9 lines
455 B
Batchfile
9 lines
455 B
Batchfile
@echo off
|
|
rem Windows analogue of stop-one.sh: stop exactly one API replica and leave it stopped.
|
|
set "cid="
|
|
echo %TARGET_INSTANCE_ID%| findstr /r "^[a-f0-9][a-f0-9]*$" >NUL || exit /b 2
|
|
for /f %%i in ('docker ps -q --filter id^=%TARGET_INSTANCE_ID% --filter label^=com.docker.compose.project^=mtusi-lab4 --filter label^=com.docker.compose.service^=api') do set "cid=%%i"
|
|
if "%cid%"=="" exit /b 3
|
|
docker stop --time 0 %cid% >NUL 2>&1
|
|
exit /b %errorlevel%
|