빌드 및 푸시 관련한 부분 추가

This commit is contained in:
2025-12-26 12:35:51 +09:00
parent 165f56a888
commit 53f2d75730
7 changed files with 119 additions and 213 deletions

43
build-and-push.ps1 Normal file
View File

@ -0,0 +1,43 @@
# 사설 Docker 레지스트리
$REGISTRY = "reg.firstgarden.co.kr"
$IMAGE_NAME = "php-apache"
Write-Host "=== PHP 이미지 빌드 및 푸시 시작 ===" -ForegroundColor Yellow
# PHP 8.2 빌드 및 푸시
Write-Host "Building PHP 8.2..." -ForegroundColor Yellow
docker build -f 8.2/Dockerfile -t "$($REGISTRY)/$($IMAGE_NAME):8.2" .
if ($LASTEXITCODE -eq 0) {
Write-Host "PHP 8.2 빌드 성공" -ForegroundColor Green
Write-Host "Pushing PHP 8.2 to registry..." -ForegroundColor Yellow
docker push "$($REGISTRY)/$($IMAGE_NAME):8.2"
if ($LASTEXITCODE -eq 0) {
Write-Host "PHP 8.2 푸시 성공" -ForegroundColor Green
} else {
Write-Host "PHP 8.2 푸시 실패" -ForegroundColor Red
exit 1
}
} else {
Write-Host "PHP 8.2 빌드 실패" -ForegroundColor Red
exit 1
}
# PHP 8.4 빌드 및 푸시
Write-Host "Building PHP 8.4..." -ForegroundColor Yellow
docker build -f 8.4/Dockerfile -t "$($REGISTRY)/$($IMAGE_NAME):8.4" .
if ($LASTEXITCODE -eq 0) {
Write-Host "PHP 8.4 빌드 성공" -ForegroundColor Green
Write-Host "Pushing PHP 8.4 to registry..." -ForegroundColor Yellow
docker push "$($REGISTRY)/$($IMAGE_NAME):8.4"
if ($LASTEXITCODE -eq 0) {
Write-Host "PHP 8.4 푸시 성공" -ForegroundColor Green
} else {
Write-Host "PHP 8.4 푸시 실패" -ForegroundColor Red
exit 1
}
} else {
Write-Host "PHP 8.4 빌드 실패" -ForegroundColor Red
exit 1
}
Write-Host "=== 모든 이미지 빌드 및 푸시 완료 ===" -ForegroundColor Green