@echo off echo ======================================== echo MC Panel - Build Docker Image echo ======================================== echo. REM Проверка Docker docker --version >nul 2>&1 if %ERRORLEVEL% NEQ 0 ( echo [ERROR] Docker is not installed or not running! echo. echo Please install Docker Desktop from: echo https://www.docker.com/products/docker-desktop echo. pause exit /b 1 ) echo [INFO] Building Docker image... echo [INFO] Registry: registry.nevetime.ru echo [INFO] Repository: registry.nevetime.ru/mc-panel echo. REM Получить текущую дату и время для тега for /f "tokens=2 delims==" %%I in ('wmic os get localdatetime /value') do set datetime=%%I set BUILD_DATE=%datetime:~0,8%-%datetime:~8,6% REM Получить короткий хеш коммита (если git доступен) git rev-parse --short HEAD >nul 2>&1 if %ERRORLEVEL% EQU 0 ( for /f %%i in ('git rev-parse --short HEAD') do set GIT_HASH=%%i ) else ( set GIT_HASH=local ) echo [STEP 1/2] Building image... echo. docker build ^ --build-arg BUILD_DATE=%BUILD_DATE% ^ --build-arg VCS_REF=%GIT_HASH% ^ --build-arg VERSION=1.1.0 ^ -t registry.nevetime.ru/mc-panel:latest ^ -t registry.nevetime.ru/mc-panel:%GIT_HASH% ^ -t registry.nevetime.ru/mc-panel:1.1.0 ^ . if %ERRORLEVEL% NEQ 0 ( echo. echo [ERROR] Build failed! echo. pause exit /b 1 ) echo. echo ======================================== echo [SUCCESS] Image built successfully! echo ======================================== echo. echo Tags: echo - registry.nevetime.ru/mc-panel:latest echo - registry.nevetime.ru/mc-panel:%GIT_HASH% echo - registry.nevetime.ru/mc-panel:1.1.0 echo. echo Next step: Run PUSH_DOCKER.bat to publish echo. pause