AI实验室前端
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
# push_docker.ps1
|
||||
|
||||
# Set version
|
||||
$env:VERSION = "1.4.6"
|
||||
|
||||
# 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!"
|
||||
Reference in New Issue
Block a user