mirror of
https://github.com/zabbix/zabbix-docker.git
synced 2025-01-10 15:48:38 +01:00
Prepare for env variable usage on Windows containers
This commit is contained in:
parent
91150fde9a
commit
f0366df138
@ -16,21 +16,20 @@ ARG CPU_MODEL=AMD64
|
||||
ARG MAJOR_VERSION=7.4
|
||||
ARG ZBX_VERSION=${MAJOR_VERSION}
|
||||
|
||||
ARG GIT_URL=https://github.com/git-for-windows/git/releases/download/v2.47.1.windows.1/MinGit-2.47.1-64-bit.zip
|
||||
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 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 PERL_URL=https://github.com/StrawberryPerl/Perl-Dist-Strawberry/releases/download/SP_54001_64bit_UCRT/strawberry-perl-5.40.0.1-64bit-portable.zip
|
||||
|
||||
ARG PCRE2_URL=https://github.com/PhilipHazel/pcre2/releases/download/pcre2-$PCRE2_VERSION/pcre2-$PCRE2_VERSION.zip
|
||||
ARG OPENSSL_URL=https://github.com/openssl/openssl/releases/download/openssl-$OPENSSL_VERSION/openssl-$OPENSSL_VERSION.tar.gz
|
||||
|
||||
ENV ZBX_VERSION=$ZBX_VERSION `
|
||||
BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL `
|
||||
GIT_URL=$GIT_URL PERL_URL=$PERL_URL SEVEN_ZIP_VERSION=$SEVEN_ZIP_VERSION `
|
||||
GIT_URL=$GIT_URL SEVEN_ZIP_VERSION=$SEVEN_ZIP_VERSION `
|
||||
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 `
|
||||
@ -53,7 +52,7 @@ ADD --checksum=sha256:2e8a40b01979afe8be0bbfb3de5dc1c6709fedb46d6c89c10da114ab5f
|
||||
RUN Set-Location -Path $env:SystemDrive\.; `
|
||||
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
|
||||
`
|
||||
$env:PATH = [string]::Format('{0}\perl\perl\bin;{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 = [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}\msys64\usr\bin;{0}\msys64\{1}\bin', $env:SystemDrive, $env:MSYSTEM.ToLower()); `
|
||||
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
|
||||
`
|
||||
@ -65,7 +64,7 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
||||
Write-Host ('Downloading {0} ...' -f $env:GIT_URL); `
|
||||
Invoke-WebRequest -OutFile $env:TEMP\git.zip -Uri $env:GIT_URL; `
|
||||
`
|
||||
$sha256 = '50b04b55425b5c465d076cdb184f63a0cd0f86f6ec8bb4d5860114a713d2c29a'; `
|
||||
$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) { `
|
||||
@ -120,24 +119,6 @@ RUN Set-Location -Path $env:SystemDrive\.; `
|
||||
# exit 1; `
|
||||
}; `
|
||||
`
|
||||
Write-Host ('Downloading {0} ...' -f $env:PERL_URL); `
|
||||
Invoke-WebRequest -OutFile $env:TEMP\perl.zip -Uri $env:PERL_URL; `
|
||||
`
|
||||
$sha256 = '754f3e2a8e473dc68d1540c7802fb166a025f35ef18960c4564a31f8b5933907'; `
|
||||
$d_sha256 = (Get-FileHash $env:TEMP\perl.zip -Algorithm sha256).Hash; `
|
||||
Write-Host ('Verifying SHA256 ({0}) ...' -f $sha256); `
|
||||
if ($d_sha256 -ne $sha256) { `
|
||||
Write-Host ('Checksum Strawberry Perl ({0}) failed!' -f $d_sha256); `
|
||||
exit 1; `
|
||||
}; `
|
||||
`
|
||||
Write-Host 'Installing Perl...'; `
|
||||
Expand-Archive -Path $env:TEMP\perl.zip -DestinationPath $env:SystemDrive\perl\; `
|
||||
Remove-Item -Force -Recurse $env:SystemDrive\perl\c\; `
|
||||
`
|
||||
Write-Host 'Verifying install ("perl -V") ...'; `
|
||||
perl -V; `
|
||||
`
|
||||
Write-Host ('Downloading {0} ...' -f $env:VS_BUILDTOOLS_URL); `
|
||||
Invoke-WebRequest -OutFile $env:TEMP\vs_buildtools.exe $env:VS_BUILDTOOLS_URL; `
|
||||
`
|
||||
|
Loading…
Reference in New Issue
Block a user