mirror of
https://github.com/zabbix/zabbix-docker.git
synced 2025-06-21 02:17:46 +02:00
Updated Windows containers build process
This commit is contained in:
parent
fb151f8cd6
commit
6b6efc6f8a
@ -6,7 +6,6 @@ FROM $BUILD_BASE_IMAGE as builder_base
|
|||||||
ARG PCRE2_VERSION=10.44
|
ARG PCRE2_VERSION=10.44
|
||||||
ARG OPENSSL_VERSION=3.3.2
|
ARG OPENSSL_VERSION=3.3.2
|
||||||
ARG GOLANG_VERSION=1.23.2
|
ARG GOLANG_VERSION=1.23.2
|
||||||
ARG SEVEN_ZIP_VERSION=2405
|
|
||||||
|
|
||||||
ARG MSYSTEM=UCRT64
|
ARG MSYSTEM=UCRT64
|
||||||
|
|
||||||
@ -16,10 +15,6 @@ ARG CPU_MODEL=AMD64
|
|||||||
ARG MAJOR_VERSION=7.4
|
ARG MAJOR_VERSION=7.4
|
||||||
ARG ZBX_VERSION=${MAJOR_VERSION}
|
ARG ZBX_VERSION=${MAJOR_VERSION}
|
||||||
|
|
||||||
ARG GIT_URL=https://github.com/git-for-windows/git/releases/download/v2.33.0.windows.2/MinGit-2.33.0.2-busybox-64-bit.zip
|
|
||||||
ARG SEVEN_ZIP_URL=https://www.7-zip.org/a/7z$SEVEN_ZIP_VERSION-$BUILD_ARCH.msi
|
|
||||||
|
|
||||||
ARG MINGW_URL=https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-win32-seh-ucrt-rt_v11-rev1.7z
|
|
||||||
ARG VS_BUILDTOOLS_URL=https://aka.ms/vs/17/release/vs_buildtools.exe
|
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 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
|
ARG MSYS2_URL=https://api.github.com/repos/msys2/msys2-installer/releases/latest
|
||||||
@ -29,8 +24,7 @@ ARG OPENSSL_URL=https://github.com/openssl/openssl/releases/download/openssl-$OP
|
|||||||
|
|
||||||
ENV ZBX_VERSION=$ZBX_VERSION `
|
ENV ZBX_VERSION=$ZBX_VERSION `
|
||||||
BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL `
|
BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL `
|
||||||
GIT_URL=$GIT_URL SEVEN_ZIP_VERSION=$SEVEN_ZIP_VERSION `
|
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_VERSION=$PCRE2_VERSION OPENSSL_VERSION=$OPENSSL_VERSION `
|
||||||
PCRE2_URL=$PCRE2_URL OPENSSL_URL=$OPENSSL_URL `
|
PCRE2_URL=$PCRE2_URL OPENSSL_URL=$OPENSSL_URL `
|
||||||
CHERE_INVOKING=yes MSYSTEM=$MSYSTEM
|
CHERE_INVOKING=yes MSYSTEM=$MSYSTEM
|
||||||
@ -52,8 +46,7 @@ ADD --checksum=sha256:2e8a40b01979afe8be0bbfb3de5dc1c6709fedb46d6c89c10da114ab5f
|
|||||||
RUN Set-Location -Path $env:SystemDrive\.; `
|
RUN Set-Location -Path $env:SystemDrive\.; `
|
||||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
|
||||||
`
|
`
|
||||||
$env:PATH = [string]::Format('{0}\mingw64\bin;{0}\go\bin;{0}\git\cmd;{0}\git\mingw64\bin;{0}\git\usr\bin;{1}\7-Zip;', $env:SystemDrive, ${env:ProgramFiles}) + $env:PATH; `
|
$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}\msys64\usr\bin;{0}\msys64\{1}\bin', $env:SystemDrive, $env:MSYSTEM.ToLower()); `
|
|
||||||
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
|
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
|
||||||
`
|
`
|
||||||
$env:BUILD_OUTPUT = [string]::Format('{0}\build_output', $env:SystemDrive); `
|
$env:BUILD_OUTPUT = [string]::Format('{0}\build_output', $env:SystemDrive); `
|
||||||
@ -61,28 +54,6 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
|||||||
$env:BUILD_SRC = [string]::Format('{0}\build_src', $env:SystemDrive); `
|
$env:BUILD_SRC = [string]::Format('{0}\build_src', $env:SystemDrive); `
|
||||||
[Environment]::SetEnvironmentVariable('BUILD_SRC', $env:BUILD_SRC, [EnvironmentVariableTarget]::Machine); `
|
[Environment]::SetEnvironmentVariable('BUILD_SRC', $env:BUILD_SRC, [EnvironmentVariableTarget]::Machine); `
|
||||||
`
|
`
|
||||||
Write-Host ('Downloading {0} ...' -f $env:GIT_URL); `
|
|
||||||
Invoke-WebRequest -OutFile $env:TEMP\git.zip -Uri $env:GIT_URL; `
|
|
||||||
`
|
|
||||||
$sha256 = '273f55e881094d00877d64f56570b0c997c4da5dedcb26738d56481033c1eba1'; `
|
|
||||||
$d_sha256 = (Get-FileHash $env:TEMP\git.zip -Algorithm sha256).Hash; `
|
|
||||||
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
|
|
||||||
if ($d_sha256 -ne $sha256) { `
|
|
||||||
Write-Host ('Checksum GIT for Windows ({0}) failed!' -f $d_sha256); `
|
|
||||||
exit 1; `
|
|
||||||
}; `
|
|
||||||
`
|
|
||||||
Write-Host ('Downloading {0} ...' -f $env:SEVEN_ZIP_URL); `
|
|
||||||
Invoke-WebRequest -OutFile $env:TEMP\7z.msi -Uri $env:SEVEN_ZIP_URL; `
|
|
||||||
`
|
|
||||||
$sha256 = '0F6AA6596D418B1694F62C8583DE05D24589B8D7FFACCE5A7DAB52AE71F832B6'; `
|
|
||||||
$d_sha256 = (Get-FileHash $env:TEMP\7z.msi -Algorithm sha256).Hash; `
|
|
||||||
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
|
|
||||||
if ($d_sha256 -ne $sha256) { `
|
|
||||||
Write-Host ('Checksum 7-zip ({0}) failed!' -f $d_sha256); `
|
|
||||||
exit 1; `
|
|
||||||
}; `
|
|
||||||
`
|
|
||||||
Write-Host ('Downloading {0} ...' -f $env:GOLANG_URL); `
|
Write-Host ('Downloading {0} ...' -f $env:GOLANG_URL); `
|
||||||
Invoke-WebRequest -OutFile $env:TEMP\go_lang.zip -Uri $env:GOLANG_URL; `
|
Invoke-WebRequest -OutFile $env:TEMP\go_lang.zip -Uri $env:GOLANG_URL; `
|
||||||
`
|
`
|
||||||
@ -94,17 +65,6 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
|||||||
exit 1; `
|
exit 1; `
|
||||||
}; `
|
}; `
|
||||||
`
|
`
|
||||||
Write-Host ('Downloading {0} ...' -f $env:MINGW_URL); `
|
|
||||||
Invoke-WebRequest -OutFile $env:TEMP\mingw.7z -Uri $env:MINGW_URL; `
|
|
||||||
`
|
|
||||||
$sha256 = '74ca64c55220edd3196681782fbff653c2b9cb4f427f9e532ab6e9a0823dc997'; `
|
|
||||||
$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:MSYS2_URL); `
|
Write-Host ('Downloading {0} ...' -f $env:MSYS2_URL); `
|
||||||
Invoke-WebRequest -OutFile $env:TEMP\msys2.sfx.exe -Uri $(Invoke-RestMethod -UseBasicParsing $env:MSYS2_URL | `
|
Invoke-WebRequest -OutFile $env:TEMP\msys2.sfx.exe -Uri $(Invoke-RestMethod -UseBasicParsing $env:MSYS2_URL | `
|
||||||
Select -ExpandProperty "assets" | `
|
Select -ExpandProperty "assets" | `
|
||||||
@ -122,42 +82,17 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
|||||||
Write-Host ('Downloading {0} ...' -f $env:VS_BUILDTOOLS_URL); `
|
Write-Host ('Downloading {0} ...' -f $env:VS_BUILDTOOLS_URL); `
|
||||||
Invoke-WebRequest -OutFile $env:TEMP\vs_buildtools.exe $env:VS_BUILDTOOLS_URL; `
|
Invoke-WebRequest -OutFile $env:TEMP\vs_buildtools.exe $env:VS_BUILDTOOLS_URL; `
|
||||||
`
|
`
|
||||||
Write-Host 'Installing GIT...'; `
|
|
||||||
Expand-Archive `
|
|
||||||
-Path $env:TEMP\git.zip `
|
|
||||||
-DestinationPath $env:SystemDrive\git\.; `
|
|
||||||
Write-Host 'Removing downloaded...'; `
|
|
||||||
`
|
|
||||||
Write-Host 'Verifying install ("git version") ...'; `
|
|
||||||
git version; `
|
|
||||||
`
|
|
||||||
Write-Host 'Installing 7z...'; `
|
|
||||||
Start-Process `
|
|
||||||
-FilePath $env:TEMP\7z.msi `
|
|
||||||
-Wait `
|
|
||||||
-ArgumentList '/qn /norestart'; `
|
|
||||||
`
|
|
||||||
Write-Host 'Verifying install ("7z -h") ...'; `
|
|
||||||
7z -h | Select -first 2; `
|
|
||||||
`
|
|
||||||
Write-Host 'Installing Go Lang...'; `
|
Write-Host 'Installing Go Lang...'; `
|
||||||
Expand-Archive -Path $env:TEMP\go_lang.zip -DestinationPath $env:SystemDrive\; `
|
Expand-Archive -Path $env:TEMP\go_lang.zip -DestinationPath $env:SystemDrive\; `
|
||||||
`
|
`
|
||||||
Write-Host 'Verifying install ("go version") ...'; `
|
Write-Host 'Verifying install ("go version") ...'; `
|
||||||
go version; `
|
go 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 'Installing MSYS2...'; `
|
Write-Host 'Installing MSYS2...'; `
|
||||||
& $env:TEMP\msys2.sfx.exe -y -o"""$env:SystemDrive\""" | Out-Null; `
|
& $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 --noconfirm -Syuu'; `
|
bash -lc 'pacman --noprogressbar --noconfirm -Syuu'; `
|
||||||
bash -lc 'pacman --noprogressbar --sync --quiet --noconfirm mingw-w64-ucrt-x86_64-cmake'; `
|
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 --noconfirm -Scc'; `
|
bash -lc 'pacman --noprogressbar --noconfirm -Scc'; `
|
||||||
bash -lc 'rm -rf /usr/share/man/* /usr/share/doc/* /usr/share/locale/*'; `
|
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/*'; `
|
bash -lc 'rm -rf /$MSYSTEM/usr/share/man/* /$MSYSTEM/usr/share/doc/* /$MSYSTEM/usr/share/locale/*'; `
|
||||||
|
@ -15,8 +15,6 @@ ARG CPU_MODEL=AMD64
|
|||||||
ARG MAJOR_VERSION=7.4
|
ARG MAJOR_VERSION=7.4
|
||||||
ARG ZBX_VERSION=${MAJOR_VERSION}
|
ARG ZBX_VERSION=${MAJOR_VERSION}
|
||||||
|
|
||||||
ARG GIT_URL=https://github.com/git-for-windows/git/releases/download/v2.33.0.windows.2/MinGit-2.33.0.2-busybox-64-bit.zip
|
|
||||||
|
|
||||||
ARG VS_BUILDTOOLS_URL=https://aka.ms/vs/17/release/vs_buildtools.exe
|
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 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
|
ARG MSYS2_URL=https://api.github.com/repos/msys2/msys2-installer/releases/latest
|
||||||
@ -26,7 +24,6 @@ ARG OPENSSL_URL=https://github.com/openssl/openssl/releases/download/openssl-$OP
|
|||||||
|
|
||||||
ENV ZBX_VERSION=$ZBX_VERSION `
|
ENV ZBX_VERSION=$ZBX_VERSION `
|
||||||
BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL `
|
BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL `
|
||||||
GIT_URL=$GIT_URL `
|
|
||||||
GOLANG_VERSION=$GOLANG_VERSION MSYS2_URL=$MSYS2_URL `
|
GOLANG_VERSION=$GOLANG_VERSION MSYS2_URL=$MSYS2_URL `
|
||||||
PCRE2_VERSION=$PCRE2_VERSION OPENSSL_VERSION=$OPENSSL_VERSION `
|
PCRE2_VERSION=$PCRE2_VERSION OPENSSL_VERSION=$OPENSSL_VERSION `
|
||||||
PCRE2_URL=$PCRE2_URL OPENSSL_URL=$OPENSSL_URL `
|
PCRE2_URL=$PCRE2_URL OPENSSL_URL=$OPENSSL_URL `
|
||||||
@ -49,8 +46,7 @@ ADD --checksum=sha256:2e8a40b01979afe8be0bbfb3de5dc1c6709fedb46d6c89c10da114ab5f
|
|||||||
RUN Set-Location -Path $env:SystemDrive\.; `
|
RUN Set-Location -Path $env:SystemDrive\.; `
|
||||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
|
||||||
`
|
`
|
||||||
$env:PATH = [string]::Format('{0}\mingw64\bin;{0}\go\bin;{0}\git\cmd;{0}\git\mingw64\bin;{0}\git\usr\bin;{1}\7-Zip;', $env:SystemDrive, ${env:ProgramFiles}) + $env:PATH; `
|
$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}\msys64\usr\bin;{0}\msys64\{1}\bin', $env:SystemDrive, $env:MSYSTEM.ToLower()); `
|
|
||||||
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
|
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
|
||||||
`
|
`
|
||||||
$env:BUILD_OUTPUT = [string]::Format('{0}\build_output', $env:SystemDrive); `
|
$env:BUILD_OUTPUT = [string]::Format('{0}\build_output', $env:SystemDrive); `
|
||||||
@ -58,21 +54,10 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
|||||||
$env:BUILD_SRC = [string]::Format('{0}\build_src', $env:SystemDrive); `
|
$env:BUILD_SRC = [string]::Format('{0}\build_src', $env:SystemDrive); `
|
||||||
[Environment]::SetEnvironmentVariable('BUILD_SRC', $env:BUILD_SRC, [EnvironmentVariableTarget]::Machine); `
|
[Environment]::SetEnvironmentVariable('BUILD_SRC', $env:BUILD_SRC, [EnvironmentVariableTarget]::Machine); `
|
||||||
`
|
`
|
||||||
Write-Host ('Downloading {0} ...' -f $env:GIT_URL); `
|
|
||||||
Invoke-WebRequest -OutFile $env:TEMP\git.zip -Uri $env:GIT_URL; `
|
|
||||||
`
|
|
||||||
$sha256 = '273f55e881094d00877d64f56570b0c997c4da5dedcb26738d56481033c1eba1'; `
|
|
||||||
$d_sha256 = (Get-FileHash $env:TEMP\git.zip -Algorithm sha256).Hash; `
|
|
||||||
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
|
|
||||||
if ($d_sha256 -ne $sha256) { `
|
|
||||||
Write-Host ('Checksum GIT for Windows ({0}) failed!' -f $d_sha256); `
|
|
||||||
exit 1; `
|
|
||||||
}; `
|
|
||||||
`
|
|
||||||
Write-Host ('Downloading {0} ...' -f $env:GOLANG_URL); `
|
Write-Host ('Downloading {0} ...' -f $env:GOLANG_URL); `
|
||||||
Invoke-WebRequest -OutFile $env:TEMP\go_lang.zip -Uri $env:GOLANG_URL; `
|
Invoke-WebRequest -OutFile $env:TEMP\go_lang.zip -Uri $env:GOLANG_URL; `
|
||||||
`
|
`
|
||||||
$sha256 = 'cab2af6951a6e2115824263f6df13ff069c47270f5788714fa1d776f7f60cb39'; `
|
$sha256 = 'bc28fe3002cd65cec65d0e4f6000584dacb8c71bfaff8801dfb532855ca42513'; `
|
||||||
$d_sha256 = (Get-FileHash $env:TEMP\go_lang.zip -Algorithm sha256).Hash; `
|
$d_sha256 = (Get-FileHash $env:TEMP\go_lang.zip -Algorithm sha256).Hash; `
|
||||||
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
|
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
|
||||||
if ($d_sha256 -ne $sha256) { `
|
if ($d_sha256 -ne $sha256) { `
|
||||||
@ -97,15 +82,6 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
|||||||
# exit 1; `
|
# exit 1; `
|
||||||
}; `
|
}; `
|
||||||
`
|
`
|
||||||
Write-Host 'Installing GIT...'; `
|
|
||||||
Expand-Archive `
|
|
||||||
-Path $env:TEMP\git.zip `
|
|
||||||
-DestinationPath $env:SystemDrive\git\.; `
|
|
||||||
Write-Host 'Removing downloaded...'; `
|
|
||||||
`
|
|
||||||
Write-Host 'Verifying install ("git version") ...'; `
|
|
||||||
git version; `
|
|
||||||
`
|
|
||||||
Write-Host 'Installing Go Lang...'; `
|
Write-Host 'Installing Go Lang...'; `
|
||||||
Expand-Archive -Path $env:TEMP\go_lang.zip -DestinationPath $env:SystemDrive\; `
|
Expand-Archive -Path $env:TEMP\go_lang.zip -DestinationPath $env:SystemDrive\; `
|
||||||
`
|
`
|
||||||
@ -117,7 +93,7 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
|||||||
& $env:TEMP\msys2.sfx.exe -y -o"""$env:SystemDrive\""" | Out-Null; `
|
& $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 --noconfirm -Syuu'; `
|
bash -lc 'pacman --noprogressbar --noconfirm -Syuu'; `
|
||||||
bash -lc 'pacman --noprogressbar --sync --quiet --noconfirm mingw-w64-clang-x86_64-gcc-compat mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-make'; `
|
bash -lc 'pacman --noprogressbar --sync --quiet --noconfirm mingw-w64-clang-x86_64-gcc-compat mingw-w64-clang-x86_64-cmake mingw-w64-clang-x86_64-make git'; `
|
||||||
bash -lc 'pacman --noprogressbar --noconfirm -Scc'; `
|
bash -lc 'pacman --noprogressbar --noconfirm -Scc'; `
|
||||||
bash -lc 'rm -rf /usr/share/man/* /usr/share/doc/* /usr/share/locale/*'; `
|
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/*'; `
|
bash -lc 'rm -rf /$MSYSTEM/usr/share/man/* /$MSYSTEM/usr/share/doc/* /$MSYSTEM/usr/share/locale/*'; `
|
||||||
|
@ -6,7 +6,6 @@ FROM $BUILD_BASE_IMAGE as builder_base
|
|||||||
ARG PCRE2_VERSION=10.44
|
ARG PCRE2_VERSION=10.44
|
||||||
ARG OPENSSL_VERSION=3.3.2
|
ARG OPENSSL_VERSION=3.3.2
|
||||||
ARG GOLANG_VERSION=1.23.2
|
ARG GOLANG_VERSION=1.23.2
|
||||||
ARG SEVEN_ZIP_VERSION=2405
|
|
||||||
|
|
||||||
ARG MSYSTEM=MINGW64
|
ARG MSYSTEM=MINGW64
|
||||||
|
|
||||||
@ -16,10 +15,6 @@ ARG CPU_MODEL=AMD64
|
|||||||
ARG MAJOR_VERSION=7.4
|
ARG MAJOR_VERSION=7.4
|
||||||
ARG ZBX_VERSION=${MAJOR_VERSION}
|
ARG ZBX_VERSION=${MAJOR_VERSION}
|
||||||
|
|
||||||
ARG GIT_URL=https://github.com/git-for-windows/git/releases/download/v2.33.0.windows.2/MinGit-2.33.0.2-busybox-64-bit.zip
|
|
||||||
ARG SEVEN_ZIP_URL=https://www.7-zip.org/a/7z$SEVEN_ZIP_VERSION-$BUILD_ARCH.msi
|
|
||||||
|
|
||||||
ARG MINGW_URL=https://github.com/niXman/mingw-builds-binaries/releases/download/13.2.0-rt_v11-rev1/x86_64-13.2.0-release-win32-seh-msvcrt-rt_v11-rev1.7z
|
|
||||||
ARG VS_BUILDTOOLS_URL=https://aka.ms/vs/17/release/vs_buildtools.exe
|
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 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
|
ARG MSYS2_URL=https://api.github.com/repos/msys2/msys2-installer/releases/latest
|
||||||
@ -29,8 +24,7 @@ ARG OPENSSL_URL=https://github.com/openssl/openssl/releases/download/openssl-$OP
|
|||||||
|
|
||||||
ENV ZBX_VERSION=$ZBX_VERSION `
|
ENV ZBX_VERSION=$ZBX_VERSION `
|
||||||
BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL `
|
BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL `
|
||||||
GIT_URL=$GIT_URL SEVEN_ZIP_VERSION=$SEVEN_ZIP_VERSION `
|
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_VERSION=$PCRE2_VERSION OPENSSL_VERSION=$OPENSSL_VERSION `
|
||||||
PCRE2_URL=$PCRE2_URL OPENSSL_URL=$OPENSSL_URL `
|
PCRE2_URL=$PCRE2_URL OPENSSL_URL=$OPENSSL_URL `
|
||||||
CHERE_INVOKING=yes MSYSTEM=$MSYSTEM
|
CHERE_INVOKING=yes MSYSTEM=$MSYSTEM
|
||||||
@ -52,8 +46,7 @@ ADD --checksum=sha256:2e8a40b01979afe8be0bbfb3de5dc1c6709fedb46d6c89c10da114ab5f
|
|||||||
RUN Set-Location -Path $env:SystemDrive\.; `
|
RUN Set-Location -Path $env:SystemDrive\.; `
|
||||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
|
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
|
||||||
`
|
`
|
||||||
$env:PATH = [string]::Format('{0}\mingw64\bin;{0}\go\bin;{0}\git\cmd;{0}\git\mingw64\bin;{0}\git\usr\bin;{1}\7-Zip;', $env:SystemDrive, ${env:ProgramFiles}) + $env:PATH; `
|
$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}\msys64\usr\bin;{0}\msys64\{1}\bin', $env:SystemDrive, $env:MSYSTEM.ToLower()); `
|
|
||||||
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
|
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
|
||||||
`
|
`
|
||||||
$env:BUILD_OUTPUT = [string]::Format('{0}\build_output', $env:SystemDrive); `
|
$env:BUILD_OUTPUT = [string]::Format('{0}\build_output', $env:SystemDrive); `
|
||||||
@ -61,28 +54,6 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
|||||||
$env:BUILD_SRC = [string]::Format('{0}\build_src', $env:SystemDrive); `
|
$env:BUILD_SRC = [string]::Format('{0}\build_src', $env:SystemDrive); `
|
||||||
[Environment]::SetEnvironmentVariable('BUILD_SRC', $env:BUILD_SRC, [EnvironmentVariableTarget]::Machine); `
|
[Environment]::SetEnvironmentVariable('BUILD_SRC', $env:BUILD_SRC, [EnvironmentVariableTarget]::Machine); `
|
||||||
`
|
`
|
||||||
Write-Host ('Downloading {0} ...' -f $env:GIT_URL); `
|
|
||||||
Invoke-WebRequest -OutFile $env:TEMP\git.zip -Uri $env:GIT_URL; `
|
|
||||||
`
|
|
||||||
$sha256 = '273f55e881094d00877d64f56570b0c997c4da5dedcb26738d56481033c1eba1'; `
|
|
||||||
$d_sha256 = (Get-FileHash $env:TEMP\git.zip -Algorithm sha256).Hash; `
|
|
||||||
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
|
|
||||||
if ($d_sha256 -ne $sha256) { `
|
|
||||||
Write-Host ('Checksum GIT for Windows ({0}) failed!' -f $d_sha256); `
|
|
||||||
exit 1; `
|
|
||||||
}; `
|
|
||||||
`
|
|
||||||
Write-Host ('Downloading {0} ...' -f $env:SEVEN_ZIP_URL); `
|
|
||||||
Invoke-WebRequest -OutFile $env:TEMP\7z.msi -Uri $env:SEVEN_ZIP_URL; `
|
|
||||||
`
|
|
||||||
$sha256 = '0F6AA6596D418B1694F62C8583DE05D24589B8D7FFACCE5A7DAB52AE71F832B6'; `
|
|
||||||
$d_sha256 = (Get-FileHash $env:TEMP\7z.msi -Algorithm sha256).Hash; `
|
|
||||||
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
|
|
||||||
if ($d_sha256 -ne $sha256) { `
|
|
||||||
Write-Host ('Checksum 7-zip ({0}) failed!' -f $d_sha256); `
|
|
||||||
exit 1; `
|
|
||||||
}; `
|
|
||||||
`
|
|
||||||
Write-Host ('Downloading {0} ...' -f $env:GOLANG_URL); `
|
Write-Host ('Downloading {0} ...' -f $env:GOLANG_URL); `
|
||||||
Invoke-WebRequest -OutFile $env:TEMP\go_lang.zip -Uri $env:GOLANG_URL; `
|
Invoke-WebRequest -OutFile $env:TEMP\go_lang.zip -Uri $env:GOLANG_URL; `
|
||||||
`
|
`
|
||||||
@ -94,17 +65,6 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
|||||||
exit 1; `
|
exit 1; `
|
||||||
}; `
|
}; `
|
||||||
`
|
`
|
||||||
Write-Host ('Downloading {0} ...' -f $env:MINGW_URL); `
|
|
||||||
Invoke-WebRequest -OutFile $env:TEMP\mingw.7z -Uri $env:MINGW_URL; `
|
|
||||||
`
|
|
||||||
$sha256 = '15B914F38F2F2E2D6F7B9B8425FF22B7E406878B01920190B09CE0DD8259C6AA'; `
|
|
||||||
$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:MSYS2_URL); `
|
Write-Host ('Downloading {0} ...' -f $env:MSYS2_URL); `
|
||||||
Invoke-WebRequest -OutFile $env:TEMP\msys2.sfx.exe -Uri $(Invoke-RestMethod -UseBasicParsing $env:MSYS2_URL | `
|
Invoke-WebRequest -OutFile $env:TEMP\msys2.sfx.exe -Uri $(Invoke-RestMethod -UseBasicParsing $env:MSYS2_URL | `
|
||||||
Select -ExpandProperty "assets" | `
|
Select -ExpandProperty "assets" | `
|
||||||
@ -122,42 +82,17 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
|||||||
Write-Host ('Downloading {0} ...' -f $env:VS_BUILDTOOLS_URL); `
|
Write-Host ('Downloading {0} ...' -f $env:VS_BUILDTOOLS_URL); `
|
||||||
Invoke-WebRequest -OutFile $env:TEMP\vs_buildtools.exe $env:VS_BUILDTOOLS_URL; `
|
Invoke-WebRequest -OutFile $env:TEMP\vs_buildtools.exe $env:VS_BUILDTOOLS_URL; `
|
||||||
`
|
`
|
||||||
Write-Host 'Installing GIT...'; `
|
|
||||||
Expand-Archive `
|
|
||||||
-Path $env:TEMP\git.zip `
|
|
||||||
-DestinationPath $env:SystemDrive\git\.; `
|
|
||||||
Write-Host 'Removing downloaded...'; `
|
|
||||||
`
|
|
||||||
Write-Host 'Verifying install ("git version") ...'; `
|
|
||||||
git version; `
|
|
||||||
`
|
|
||||||
Write-Host 'Installing 7z...'; `
|
|
||||||
Start-Process `
|
|
||||||
-FilePath $env:TEMP\7z.msi `
|
|
||||||
-Wait `
|
|
||||||
-ArgumentList '/qn /norestart'; `
|
|
||||||
`
|
|
||||||
Write-Host 'Verifying install ("7z -h") ...'; `
|
|
||||||
7z -h | Select -first 2; `
|
|
||||||
`
|
|
||||||
Write-Host 'Installing Go Lang...'; `
|
Write-Host 'Installing Go Lang...'; `
|
||||||
Expand-Archive -Path $env:TEMP\go_lang.zip -DestinationPath $env:SystemDrive\; `
|
Expand-Archive -Path $env:TEMP\go_lang.zip -DestinationPath $env:SystemDrive\; `
|
||||||
`
|
`
|
||||||
Write-Host 'Verifying install ("go version") ...'; `
|
Write-Host 'Verifying install ("go version") ...'; `
|
||||||
go version; `
|
go 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 'Installing MSYS2...'; `
|
Write-Host 'Installing MSYS2...'; `
|
||||||
& $env:TEMP\msys2.sfx.exe -y -o"""$env:SystemDrive\""" | Out-Null; `
|
& $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 --noconfirm -Syuu'; `
|
bash -lc 'pacman --noprogressbar --noconfirm -Syuu'; `
|
||||||
bash -lc 'pacman --noprogressbar --sync --quiet --noconfirm mingw-w64-x86_64-cmake'; `
|
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 --noconfirm -Scc'; `
|
bash -lc 'pacman --noprogressbar --noconfirm -Scc'; `
|
||||||
bash -lc 'rm -rf /usr/share/man/* /usr/share/doc/* /usr/share/locale/*'; `
|
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/*'; `
|
bash -lc 'rm -rf /$MSYSTEM/usr/share/man/* /$MSYSTEM/usr/share/doc/* /$MSYSTEM/usr/share/locale/*'; `
|
||||||
|
@ -11,12 +11,12 @@ ARG CPU_MODEL=AMD64
|
|||||||
ARG MAJOR_VERSION=7.4
|
ARG MAJOR_VERSION=7.4
|
||||||
ARG ZBX_VERSION=${MAJOR_VERSION}
|
ARG ZBX_VERSION=${MAJOR_VERSION}
|
||||||
|
|
||||||
ARG GIT_URL=https://github.com/git-for-windows/git/releases/download/v2.33.0.windows.2/MinGit-2.33.0.2-busybox-64-bit.zip
|
ARG GIT_URL=https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.1/MinGit-2.47.1-busybox-64-bit.zip
|
||||||
|
|
||||||
ARG VS_BUILDTOOLS_URL=https://aka.ms/vs/17/release/vs_buildtools.exe
|
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 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/20241217/llvm-mingw-20241217-ucrt-x86_64.zip
|
||||||
ARG VCPKG_GIT=https://github.com/microsoft/vcpkg
|
ARG VCPKG_GIT=https://github.com/microsoft/vcpkg.git
|
||||||
|
|
||||||
ENV ZBX_VERSION=$ZBX_VERSION `
|
ENV ZBX_VERSION=$ZBX_VERSION `
|
||||||
BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL `
|
BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL `
|
||||||
@ -49,7 +49,7 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
|||||||
Write-Host ('Downloading {0} ...' -f $env:GIT_URL); `
|
Write-Host ('Downloading {0} ...' -f $env:GIT_URL); `
|
||||||
Invoke-WebRequest -OutFile $env:TEMP\git.zip -Uri $env:GIT_URL; `
|
Invoke-WebRequest -OutFile $env:TEMP\git.zip -Uri $env:GIT_URL; `
|
||||||
`
|
`
|
||||||
$sha256 = '273f55e881094d00877d64f56570b0c997c4da5dedcb26738d56481033c1eba1'; `
|
$sha256 = '7b26cc61866c5c0ec050797f57837bf064eacd3aaa87ae316e96c6936235cf29'; `
|
||||||
$d_sha256 = (Get-FileHash $env:TEMP\git.zip -Algorithm sha256).Hash; `
|
$d_sha256 = (Get-FileHash $env:TEMP\git.zip -Algorithm sha256).Hash; `
|
||||||
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
|
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
|
||||||
if ($d_sha256 -ne $sha256) { `
|
if ($d_sha256 -ne $sha256) { `
|
||||||
@ -98,7 +98,7 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
|||||||
`
|
`
|
||||||
Write-Host 'Installing LLVM MinGW ...'; `
|
Write-Host 'Installing LLVM MinGW ...'; `
|
||||||
Expand-Archive -Path $env:TEMP\llvm_mingw.zip -DestinationPath $env:SystemDrive\; `
|
Expand-Archive -Path $env:TEMP\llvm_mingw.zip -DestinationPath $env:SystemDrive\; `
|
||||||
Move-Item -Path $env:SystemDrive\llvm-mingw-20240502-ucrt-x86_64\ -Destination $env:SystemDrive\llvm_mingw; `
|
Move-Item -Path $env:SystemDrive\llvm-mingw-20241217-ucrt-x86_64\ -Destination $env:SystemDrive\llvm_mingw; `
|
||||||
`
|
`
|
||||||
Write-Host 'Verifying install ("gcc -v") ...'; `
|
Write-Host 'Verifying install ("gcc -v") ...'; `
|
||||||
gcc -v; `
|
gcc -v; `
|
||||||
|
@ -110,7 +110,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; `
|
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; `
|
mingw32-make -s clean; `
|
||||||
`
|
`
|
||||||
|
|
||||||
Write-Host ('Building Zabbix Ember+ plugin {0} version ...' -f $env:EMBER_PLUS_PLUGIN_VERSION); `
|
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; `
|
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; `
|
Set-Location -Path $env:SystemDrive\ember-plus-plugin-$env:EMBER_PLUS_PLUGIN_VERSION; `
|
||||||
|
Loading…
x
Reference in New Issue
Block a user