Files
jobboard/deploy/2-build-image.ps1
T

14 lines
641 B
PowerShell

# Step 2, on Windows: build the image from the tree step 1 exported, with wslc.
# Tags <IMAGE>:<sha> and <IMAGE>:latest. Never pushes; 3-push-image.ps1 does.
$ErrorActionPreference = 'Stop'
. "$PSScriptRoot\_common.ps1"
Assert-Wslc
$sha = Get-ReleaseSha
$context = Join-Path $Release $sha
Write-Host "== build ${Image}:$sha from $context" -ForegroundColor Cyan
# -f is a path wslc opens itself, not one inside the context.
wslc build -t "${Image}:$sha" -t "${Image}:latest" -f "$context\deploy\Dockerfile" $context
if ($LASTEXITCODE -ne 0) { throw "wslc build failed (exit $LASTEXITCODE)" }
wslc image list
Write-Host "Image: ${Image}:$sha"