Files
AILab/vue2/scripts/push_docker.ps1
T
2026-04-14 10:10:52 +08:00

38 lines
904 B
PowerShell

# push_docker.ps1
# Set version
$env:VERSION = "1.5.3"
# Docker registry/repository
$registry = "ai.ronsunny.cn:13011/bbit_ai/ce_vue"
# Dockerfile path
$dockerfilePath = ".\scripts\deploy\Dockerfile"
# --- Construct tags safely for older PowerShell ---
$tag = $registry + ":" + $env:VERSION
$latestTag = $registry + ":latest"
# Optional: check if Docker is available
if (-not (Get-Command docker -ErrorAction SilentlyContinue)) {
Write-Error "Docker not found. Make sure Docker is installed and in PATH."
exit 1
}
# Build the Docker image
Write-Host "Building image: $tag"
docker build -f $dockerfilePath -t $tag .
# Tag as latest
Write-Host "Tagging image as latest: $latestTag"
docker tag $tag $latestTag
# Push both images
Write-Host "Pushing image: $tag"
docker push $tag
Write-Host "Pushing image: $latestTag"
docker push $latestTag
Write-Host "Docker image build and push completed!"