param( [string]$ImageName = "yzx-oa-sfu:0.1.0-live", [string]$Platform = "linux/amd64", [string]$Output = "yzx-oa-sfu_0.1.0-live_linux-amd64.tar" ) $ErrorActionPreference = "Stop" $root = Resolve-Path (Join-Path $PSScriptRoot "..") Push-Location $root try { docker build --platform $Platform -t $ImageName . if ($LASTEXITCODE -ne 0) { throw "docker build failed with exit code $LASTEXITCODE" } docker save -o $Output $ImageName if ($LASTEXITCODE -ne 0) { throw "docker save failed with exit code $LASTEXITCODE" } Write-Host "Saved $ImageName to $Output" -ForegroundColor Green } finally { Pop-Location }