44 lines
1.5 KiB
PowerShell
44 lines
1.5 KiB
PowerShell
# 사설 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
|