From 7e4dea72293b590e810d4947c5ca4da6dd132870 Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Tue, 21 May 2024 02:49:40 +0900 Subject: [PATCH] Updated build process for Zabbix agent (windows) --- .../build-base/windows/Dockerfile.agent2 | 27 ++++++++++++------- 1 file changed, 18 insertions(+), 9 deletions(-) diff --git a/Dockerfiles/build-base/windows/Dockerfile.agent2 b/Dockerfiles/build-base/windows/Dockerfile.agent2 index 49a8adba8..3d136049f 100644 --- a/Dockerfiles/build-base/windows/Dockerfile.agent2 +++ b/Dockerfiles/build-base/windows/Dockerfile.agent2 @@ -44,15 +44,24 @@ LABEL org.opencontainers.image.title="Zabbix agent 2 build base for Windows" ` SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; ` - Invoke-WebRequest -UseBasicParsing -uri "https://github.com/msys2/msys2-installer/releases/download/nightly-x86_64/msys2-base-x86_64-latest.sfx.exe" -OutFile C:\msys2.exe; ` - C:\msys2.exe -y -oC:\; ` - Remove-Item msys2.exe ; ` - function msys() { C:\msys64\usr\bin\bash.exe @('-lc') + @Args; } ` - msys ' '; ` - msys 'pacman --noconfirm -Syuu'; ` - msys 'pacman --noconfirm -Syuu'; ` - msys 'pacman --sync --quiet --noconfirm mingw-w64-ucrt-x86_64-cmake'; ` - msys 'pacman --noconfirm -Scc'; + Write-Host ('Downloading {0} ...' -f $env:MSYS2_URL); ` + Invoke-WebRequest -OutFile $env:TEMP\msys2.sfx.exe -Uri $env:MSYS2_URL; ` + ` + $sha256 = 'D96C53ECBFA4B9D81F6C58077965BB2E31472A8BDA4D4446EF8F45F9C601B11D'; ` + $d_sha256 = (Get-FileHash $env:TEMP\msys2.sfx.exe -Algorithm sha256).Hash; ` + Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); ` + if ($d_sha256 -ne $sha256) { ` + Write-Host ('Checksum MSYS2 ({0}) failed!' -f $d_sha256); ` + exit 1; ` + }; ` + & $env:TEMP\msys2.sfx.exe -y -o"""$env:SystemDrive\""" | Out-Null; ` + function msys() { C:\msys64\usr\bin\bash.exe @('-lc') + @Args; } ` + msys ' '; ` + msys 'pacman --noconfirm -Syuu'; ` + msys 'pacman --noconfirm -Syuu'; ` + msys 'pacman --sync --quiet --noconfirm mingw-w64-ucrt-x86_64-cmake'; ` + msys 'pacman --noconfirm -Scc'; ` + Remove-Item -Force -Recurse $env:TEMP\*; RUN Set-Location -Path $env:SystemDrive\.; ` [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `