Skip to content

Commit 5b1e858

Browse files
committed
set Chocolatey version to 1.4.0 to avoid .NET Framework 4.8 dependency; add error handling for Docker build failures in docker.ps1
1 parent 82b8a9b commit 5b1e858

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

Dockerfile.windows.x86_64

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ FROM mcr.microsoft.com/windows/servercore:$WIN_VER
88

99
ENV chocolateyUseWindowsCompression "true"
1010
ENV RUST_TOOLCHAIN="1.46.0"
11+
# Set Chocolatey version to 1.4.0 to avoid .NET Framework 4.8 dependency
12+
ENV chocolateyVersion="1.4.0"
1113

1214
ADD https://aka.ms/vs/16/release/vs_buildtools.exe C:\TEMP\vs_buildtools.exe
1315
ADD https://win.rustup.rs/x86_64 C:\TEMP\rustup-init.exe

docker.ps1

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,17 @@ function Build-Tag {
3434
}
3535

3636
function Build-Container {
37+
# Build the container and check for failures
38+
# Docker build returns 0 on success, non-zero on failure
3739
$tag = Build-Tag
3840
docker build -t $tag `
39-
--build-arg GIT_BRANCH=$GIT_BRANCH `
40-
--build-arg GIT_COMMIT=$GIT_COMMIT `
41-
-f Dockerfile.windows.x86_64 .
41+
--build-arg GIT_BRANCH=$GIT_BRANCH `
42+
--build-arg GIT_COMMIT=$GIT_COMMIT `
43+
-f Dockerfile.windows.x86_64 .
44+
if ($LASTEXITCODE -ne 0) {
45+
Write-Error "Build failed with exit code $LASTEXITCODE"
46+
exit $LASTEXITCODE
47+
}
4248
Write-Host "Build completed for $tag"
4349
}
4450

0 commit comments

Comments
 (0)