Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 

26 wiersze
638 B

  1. param(
  2. [string]$ImageName = "yzx-oa-sfu:0.1.0-live",
  3. [string]$Platform = "linux/amd64",
  4. [string]$Output = "yzx-oa-sfu_0.1.0-live_linux-amd64.tar"
  5. )
  6. $ErrorActionPreference = "Stop"
  7. $root = Resolve-Path (Join-Path $PSScriptRoot "..")
  8. Push-Location $root
  9. try {
  10. docker build --platform $Platform -t $ImageName .
  11. if ($LASTEXITCODE -ne 0) {
  12. throw "docker build failed with exit code $LASTEXITCODE"
  13. }
  14. docker save -o $Output $ImageName
  15. if ($LASTEXITCODE -ne 0) {
  16. throw "docker save failed with exit code $LASTEXITCODE"
  17. }
  18. Write-Host "Saved $ImageName to $Output" -ForegroundColor Green
  19. } finally {
  20. Pop-Location
  21. }