mirror of
https://github.com/zabbix/zabbix-docker.git
synced 2025-01-05 05:09:39 +01:00
Fixed Windows containers building
This commit is contained in:
parent
6b6efc6f8a
commit
ab18a9f39f
@ -15,6 +15,7 @@ ARG CPU_MODEL=AMD64
|
||||
ARG MAJOR_VERSION=7.4
|
||||
ARG ZBX_VERSION=${MAJOR_VERSION}
|
||||
|
||||
ARG MINGW_URL=https://github.com/niXman/mingw-builds-binaries/releases/download/14.2.0-rt_v12-rev0/x86_64-14.2.0-release-win32-seh-ucrt-rt_v12-rev0.7z
|
||||
ARG VS_BUILDTOOLS_URL=https://aka.ms/vs/17/release/vs_buildtools.exe
|
||||
ARG GOLANG_URL=https://go.dev/dl/go$GOLANG_VERSION.windows-amd64.zip
|
||||
ARG MSYS2_URL=https://api.github.com/repos/msys2/msys2-installer/releases/latest
|
||||
@ -24,7 +25,7 @@ ARG OPENSSL_URL=https://github.com/openssl/openssl/releases/download/openssl-$OP
|
||||
|
||||
ENV ZBX_VERSION=$ZBX_VERSION `
|
||||
BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL `
|
||||
VS_BUILDTOOLS_URL=$VS_BUILDTOOLS_URL GOLANG_VERSION=$GOLANG_VERSION MSYS2_URL=$MSYS2_URL `
|
||||
MINGW_URL=$MINGW_URL VS_BUILDTOOLS_URL=$VS_BUILDTOOLS_URL GOLANG_VERSION=$GOLANG_VERSION MSYS2_URL=$MSYS2_URL `
|
||||
PCRE2_VERSION=$PCRE2_VERSION OPENSSL_VERSION=$OPENSSL_VERSION `
|
||||
PCRE2_URL=$PCRE2_URL OPENSSL_URL=$OPENSSL_URL `
|
||||
CHERE_INVOKING=yes MSYSTEM=$MSYSTEM
|
||||
@ -46,7 +47,7 @@ ADD --checksum=sha256:2e8a40b01979afe8be0bbfb3de5dc1c6709fedb46d6c89c10da114ab5f
|
||||
RUN Set-Location -Path $env:SystemDrive\.; `
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
|
||||
`
|
||||
$env:PATH = $env:PATH + [string]::Format(';{0}\go\bin;{0}\msys64\usr\bin;{0}\msys64\{1}\bin', $env:SystemDrive, $env:MSYSTEM.ToLower()); `
|
||||
$env:PATH = $env:PATH + [string]::Format(';{0}\mingw64\bin;{0}\go\bin;{0}\msys64\usr\bin;{0}\msys64\{1}\bin', $env:SystemDrive, $env:MSYSTEM.ToLower()); `
|
||||
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
|
||||
`
|
||||
$env:BUILD_OUTPUT = [string]::Format('{0}\build_output', $env:SystemDrive); `
|
||||
@ -79,6 +80,17 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
||||
# exit 1; `
|
||||
}; `
|
||||
`
|
||||
Write-Host ('Downloading {0} ...' -f $env:MINGW_URL); `
|
||||
Invoke-WebRequest -OutFile $env:TEMP\mingw.7z -Uri $env:MINGW_URL; `
|
||||
`
|
||||
$sha256 = 'd7270f76483aefe0c88f45284b374e27648dec59fb6f89ee2f5cb62f6a060082'; `
|
||||
$d_sha256 = (Get-FileHash $env:TEMP\mingw.7z -Algorithm sha256).Hash; `
|
||||
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
|
||||
if ($d_sha256 -ne $sha256) { `
|
||||
Write-Host ('Checksum Mingw-w64 ({0}) failed!' -f $d_sha256); `
|
||||
exit 1; `
|
||||
}; `
|
||||
`
|
||||
Write-Host ('Downloading {0} ...' -f $env:VS_BUILDTOOLS_URL); `
|
||||
Invoke-WebRequest -OutFile $env:TEMP\vs_buildtools.exe $env:VS_BUILDTOOLS_URL; `
|
||||
`
|
||||
@ -92,7 +104,7 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
||||
& $env:TEMP\msys2.sfx.exe -y -o"""$env:SystemDrive\""" | Out-Null; `
|
||||
bash -lc 'pacman --noprogressbar --noconfirm -Syuu'; `
|
||||
bash -lc 'pacman --noprogressbar --noconfirm -Syuu'; `
|
||||
bash -lc 'pacman --noprogressbar --sync --quiet --noconfirm mingw-w64-ucrt-x86_64-gcc mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-make git'; `
|
||||
bash -lc 'pacman --noprogressbar --sync --quiet --noconfirm mingw-w64-ucrt-x86_64-cmake mingw-w64-ucrt-x86_64-make mingw-w64-ucrt-x86_64-7zip git'; `
|
||||
bash -lc 'pacman --noprogressbar --noconfirm -Scc'; `
|
||||
bash -lc 'rm -rf /usr/share/man/* /usr/share/doc/* /usr/share/locale/*'; `
|
||||
bash -lc 'rm -rf /$MSYSTEM/usr/share/man/* /$MSYSTEM/usr/share/doc/* /$MSYSTEM/usr/share/locale/*'; `
|
||||
@ -104,6 +116,13 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
||||
Write-Host 'Verifying install ("bash --version") ...'; `
|
||||
bash --version; `
|
||||
`
|
||||
Write-Host 'Installing Mingw-w64...'; `
|
||||
7z x $env:TEMP\mingw.7z; `
|
||||
compact /c /i /s:$env:SystemDrive\mingw64 | Out-Null; `
|
||||
`
|
||||
Write-Host 'Verifying install ("gcc -v") ...'; `
|
||||
gcc -v; `
|
||||
`
|
||||
Write-Host ('{0} - Visual Studio components installing...' -f $(Get-Date -format 'u')); `
|
||||
cmd /C start /w $env:TEMP\vs_buildtools.exe `
|
||||
--quiet `
|
||||
|
@ -15,6 +15,7 @@ ARG CPU_MODEL=AMD64
|
||||
ARG MAJOR_VERSION=7.4
|
||||
ARG ZBX_VERSION=${MAJOR_VERSION}
|
||||
|
||||
ARG MINGW_URL=https://github.com/niXman/mingw-builds-binaries/releases/download/14.2.0-rt_v12-rev0/x86_64-14.2.0-release-win32-seh-msvcrt-rt_v12-rev0.7z
|
||||
ARG VS_BUILDTOOLS_URL=https://aka.ms/vs/17/release/vs_buildtools.exe
|
||||
ARG GOLANG_URL=https://go.dev/dl/go$GOLANG_VERSION.windows-amd64.zip
|
||||
ARG MSYS2_URL=https://api.github.com/repos/msys2/msys2-installer/releases/latest
|
||||
@ -24,7 +25,7 @@ ARG OPENSSL_URL=https://github.com/openssl/openssl/releases/download/openssl-$OP
|
||||
|
||||
ENV ZBX_VERSION=$ZBX_VERSION `
|
||||
BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL `
|
||||
VS_BUILDTOOLS_URL=$VS_BUILDTOOLS_URL GOLANG_VERSION=$GOLANG_VERSION MSYS2_URL=$MSYS2_URL `
|
||||
MINGW_URL=$MINGW_URL VS_BUILDTOOLS_URL=$VS_BUILDTOOLS_URL GOLANG_VERSION=$GOLANG_VERSION MSYS2_URL=$MSYS2_URL `
|
||||
PCRE2_VERSION=$PCRE2_VERSION OPENSSL_VERSION=$OPENSSL_VERSION `
|
||||
PCRE2_URL=$PCRE2_URL OPENSSL_URL=$OPENSSL_URL `
|
||||
CHERE_INVOKING=yes MSYSTEM=$MSYSTEM
|
||||
@ -46,7 +47,7 @@ ADD --checksum=sha256:2e8a40b01979afe8be0bbfb3de5dc1c6709fedb46d6c89c10da114ab5f
|
||||
RUN Set-Location -Path $env:SystemDrive\.; `
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
|
||||
`
|
||||
$env:PATH = $env:PATH + [string]::Format(';{0}\go\bin;{0}\msys64\usr\bin;{0}\msys64\{1}\bin', $env:SystemDrive, $env:MSYSTEM.ToLower()); `
|
||||
$env:PATH = $env:PATH + [string]::Format(';{0}\mingw64\bin;{0}\go\bin;{0}\msys64\usr\bin;{0}\msys64\{1}\bin', $env:SystemDrive, $env:MSYSTEM.ToLower()); `
|
||||
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
|
||||
`
|
||||
$env:BUILD_OUTPUT = [string]::Format('{0}\build_output', $env:SystemDrive); `
|
||||
@ -79,6 +80,17 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
||||
# exit 1; `
|
||||
}; `
|
||||
`
|
||||
Write-Host ('Downloading {0} ...' -f $env:MINGW_URL); `
|
||||
Invoke-WebRequest -OutFile $env:TEMP\mingw.7z -Uri $env:MINGW_URL; `
|
||||
`
|
||||
$sha256 = '32bf3d1337c89f1f0326b42f49fea96fc7eb115af29b765a69bc69be546fd2a1'; `
|
||||
$d_sha256 = (Get-FileHash $env:TEMP\mingw.7z -Algorithm sha256).Hash; `
|
||||
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
|
||||
if ($d_sha256 -ne $sha256) { `
|
||||
Write-Host ('Checksum Mingw-w64 ({0}) failed!' -f $d_sha256); `
|
||||
exit 1; `
|
||||
}; `
|
||||
`
|
||||
Write-Host ('Downloading {0} ...' -f $env:VS_BUILDTOOLS_URL); `
|
||||
Invoke-WebRequest -OutFile $env:TEMP\vs_buildtools.exe $env:VS_BUILDTOOLS_URL; `
|
||||
`
|
||||
@ -92,7 +104,7 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
||||
& $env:TEMP\msys2.sfx.exe -y -o"""$env:SystemDrive\""" | Out-Null; `
|
||||
bash -lc 'pacman --noprogressbar --noconfirm -Syuu'; `
|
||||
bash -lc 'pacman --noprogressbar --noconfirm -Syuu'; `
|
||||
bash -lc 'pacman --noprogressbar --sync --quiet --noconfirm mingw-w64-x86_64-gcc mingw-w64-x86_64-cmake mingw-w64-x86_64-make git'; `
|
||||
bash -lc 'pacman --noprogressbar --sync --quiet --noconfirm mingw-w64-x86_64-cmake mingw-w64-x86_64-make mingw-w64-x86_64-7zip git'; `
|
||||
bash -lc 'pacman --noprogressbar --noconfirm -Scc'; `
|
||||
bash -lc 'rm -rf /usr/share/man/* /usr/share/doc/* /usr/share/locale/*'; `
|
||||
bash -lc 'rm -rf /$MSYSTEM/usr/share/man/* /$MSYSTEM/usr/share/doc/* /$MSYSTEM/usr/share/locale/*'; `
|
||||
@ -104,6 +116,13 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
||||
Write-Host 'Verifying install ("bash --version") ...'; `
|
||||
bash --version; `
|
||||
`
|
||||
Write-Host 'Installing Mingw-w64...'; `
|
||||
7z x $env:TEMP\mingw.7z; `
|
||||
compact /c /i /s:$env:SystemDrive\mingw64 | Out-Null; `
|
||||
`
|
||||
Write-Host 'Verifying install ("gcc -v") ...'; `
|
||||
gcc -v; `
|
||||
`
|
||||
Write-Host ('{0} - Visual Studio components installing...' -f $(Get-Date -format 'u')); `
|
||||
cmd /C start /w $env:TEMP\vs_buildtools.exe `
|
||||
--quiet `
|
||||
|
@ -15,7 +15,7 @@ ARG GIT_URL=https://github.com/git-for-windows/git/releases/download/v2.47.1.win
|
||||
|
||||
ARG VS_BUILDTOOLS_URL=https://aka.ms/vs/17/release/vs_buildtools.exe
|
||||
ARG GOLANG_URL=https://go.dev/dl/go$GOLANG_VERSION.windows-amd64.zip
|
||||
ARG LLVM_MINGW=https://github.com/mstorsjo/llvm-mingw/releases/download/20241217/llvm-mingw-20241217-ucrt-x86_64.zip
|
||||
ARG LLVM_MINGW=https://github.com/mstorsjo/llvm-mingw/releases/download/20241030/llvm-mingw-20241030-ucrt-x86_64.zip
|
||||
ARG VCPKG_GIT=https://github.com/microsoft/vcpkg.git
|
||||
|
||||
ENV ZBX_VERSION=$ZBX_VERSION `
|
||||
@ -71,7 +71,7 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
||||
Write-Host ('Downloading {0} ...' -f $env:LLVM_MINGW); `
|
||||
Invoke-WebRequest -OutFile $env:TEMP\llvm_mingw.zip -Uri $env:LLVM_MINGW; `
|
||||
`
|
||||
$sha256 = 'f4f3ad8616c4183ce7b0d72df634400945b41ea9816145fc2430df6003455db7'; `
|
||||
$sha256 = '7dd9884c976bb20bcbcda9077aa3dd2e857cfd073012f39668cdeddb285d93f8'; `
|
||||
$d_sha256 = (Get-FileHash $env:TEMP\llvm_mingw.zip -Algorithm sha256).Hash; `
|
||||
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
|
||||
if ((Get-FileHash $env:TEMP\llvm_mingw.zip -Algorithm sha256).Hash -ne $sha256) { `
|
||||
@ -98,7 +98,7 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
||||
`
|
||||
Write-Host 'Installing LLVM MinGW ...'; `
|
||||
Expand-Archive -Path $env:TEMP\llvm_mingw.zip -DestinationPath $env:SystemDrive\; `
|
||||
Move-Item -Path $env:SystemDrive\llvm-mingw-20241217-ucrt-x86_64\ -Destination $env:SystemDrive\llvm_mingw; `
|
||||
Move-Item -Path $env:SystemDrive\llvm-mingw-20241030-ucrt-x86_64\ -Destination $env:SystemDrive\llvm_mingw; `
|
||||
`
|
||||
Write-Host 'Verifying install ("gcc -v") ...'; `
|
||||
gcc -v; `
|
||||
|
@ -111,7 +111,6 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
||||
Copy-Item -Path $env:SystemDrive\mssql-plugin-$env:MSSQL_PLUGIN_VERSION\mssql.conf $env:ZBX_OUTPUT_DIR\conf\zabbix_agent2.d\plugins.d; `
|
||||
mingw32-make -s clean; `
|
||||
`
|
||||
|
||||
Write-Host ('Building Zabbix Ember+ plugin {0} version ...' -f $env:EMBER_PLUS_PLUGIN_VERSION); `
|
||||
git -c advice.detachedHead=false clone $env:EMBER_PLUS_PLUGIN_SOURCES --branch $env:EMBER_PLUS_PLUGIN_VERSION --depth 1 --single-branch $env:SystemDrive\ember-plus-plugin-$env:EMBER_PLUS_PLUGIN_VERSION; `
|
||||
Set-Location -Path $env:SystemDrive\ember-plus-plugin-$env:EMBER_PLUS_PLUGIN_VERSION; `
|
||||
|
Loading…
Reference in New Issue
Block a user