build-images.bat 663 Bytes
@echo off
chcp 65001 >nul
REM HaHRCS Docker 镜像打包脚本
REM @author zzy

set "OUTPUT_DIR=..\..\runing"
set "OUTPUT_TAR=%OUTPUT_DIR%\hahrcs-images.tar"
if not exist "%OUTPUT_DIR%" mkdir "%OUTPUT_DIR%"

echo 正在构建后端镜像...
docker-compose build api

if %ERRORLEVEL% NEQ 0 (
    echo 镜像构建失败
    exit /b 1
)

echo 正在导出所有镜像...
docker save -o "%OUTPUT_TAR%" hahrcs/api:latest masstransit/rabbitmq:4.1.3 redis:7.2-alpine postgis/postgis:15-3.4 emqx/emqx:5.5 nginx:1.25-alpine portainer/portainer-ce:lts

if %ERRORLEVEL% EQU 0 (
    echo 镜像导出完成: %OUTPUT_TAR%
) else (
    echo 镜像导出失败
    exit /b 1
)