From f81b067643ad272df4c8e6325840d5e87d75c70c Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Mon, 20 May 2024 11:47:41 +0900 Subject: [PATCH] Updated build process for Zabbix agent (windows) --- .../build-base/windows/Dockerfile.agent | 20 +++++++++---------- .../build-base/windows/Dockerfile.agent2 | 4 ++-- .../windows/Dockerfile_llvm_clang.agent2 | 4 ++-- .../windows/Dockerfile_msvcrt.agent2 | 4 ++-- .../windows/Dockerfile_vcpkg.agent2 | 2 +- 5 files changed, 16 insertions(+), 18 deletions(-) diff --git a/Dockerfiles/build-base/windows/Dockerfile.agent b/Dockerfiles/build-base/windows/Dockerfile.agent index e63efbed1..dd7c5b82a 100644 --- a/Dockerfiles/build-base/windows/Dockerfile.agent +++ b/Dockerfiles/build-base/windows/Dockerfile.agent @@ -41,12 +41,14 @@ LABEL org.opencontainers.image.title="Zabbix agent build base for Windows" ` SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] +COPY modbus.vs16.* C:\build_src\libmodbus_project\ + RUN Set-Location -Path $env:SystemDrive\.; ` [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; ` - ` + ` $env:PATH = [string]::Format('{0}\perl\perl\bin;{1}\NASM;{0}\git\cmd;{0}\git\mingw64\bin;{0}\git\usr\bin;', $env:SystemDrive, ${env:ProgramFiles}) + $env:PATH; ` [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); ` - ` + ` $env:BUILD_OUTPUT = [string]::Format('{0}\build_output', $env:SystemDrive); ` [Environment]::SetEnvironmentVariable('BUILD_OUTPUT', $env:BUILD_OUTPUT, [EnvironmentVariableTarget]::Machine); ` $env:BUILD_SRC = [string]::Format('{0}\build_src', $env:SystemDrive); ` @@ -124,20 +126,16 @@ RUN Set-Location -Path $env:SystemDrive\.; ` }; ` Wait-Process -name msiexec; ` Write-Host ('{0} - Visual Studio components installed' -f $(Get-Date -format 'u')); ` - ` - $env:VS_PATH = &(Join-Path ${env:ProgramFiles(x86)} """\Microsoft Visual Studio\Installer\vswhere.exe""") -latest -products Microsoft.VisualStudio.Product.BuildTools -property installationPath; ` + ` + $env:VS_PATH = &(Join-Path ${env:ProgramFiles(x86)} """\Microsoft Visual Studio\Installer\vswhere.exe""") -latest -products Microsoft.VisualStudio.Product.BuildTools -property installationPath; ` [Environment]::SetEnvironmentVariable('VS_PATH', $env:VS_PATH, [EnvironmentVariableTarget]::Machine); ` ` Write-Host 'Visual Studio components installation cleanup'; ` - Write-Host 'Removing downloaded...'; ` - Remove-Item -Force -Path $env:SystemDrive\vs_buildtools.exe; ` Get-ChildItem -Path """${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer""" -Directory -Recurse | Remove-Item -Force -Recurse; ` + Write-Host 'Removing downloaded...'; ` Remove-Item -Force -Recurse $env:TEMP\*; ` - Write-Host 'Build environment is ready...'; - -COPY modbus.vs16.* C:\build_src\libmodbus_project\ - -RUN Set-Location -Path $env:SystemDrive\.; ` + Write-Host 'Build environment is ready...'; ` + Set-Location -Path $env:SystemDrive\.; ` [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; ` ` New-Item -ItemType directory -Path $env:BUILD_OUTPUT -Force | Out-Null; ` diff --git a/Dockerfiles/build-base/windows/Dockerfile.agent2 b/Dockerfiles/build-base/windows/Dockerfile.agent2 index d8843313c..f7510cf89 100644 --- a/Dockerfiles/build-base/windows/Dockerfile.agent2 +++ b/Dockerfiles/build-base/windows/Dockerfile.agent2 @@ -44,7 +44,7 @@ LABEL org.opencontainers.image.title="Zabbix agent 2 build base for Windows" ` SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] RUN Set-Location -Path $env:SystemDrive\.; ` - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13; ` + [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}\msys64\usr\bin;{0}\msys64\ucrt64\bin;{0}\msys64\mingw64\bin', $env:SystemDrive); ` @@ -182,7 +182,7 @@ RUN Set-Location -Path $env:SystemDrive\.; ` Remove-Item -Force -Recurse $env:TEMP\*; ` Write-Host 'Build environment is ready...'; ` ` - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13; ` + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; ` ` New-Item -ItemType directory -Path $env:BUILD_OUTPUT -Force | Out-Null; ` New-Item -ItemType directory -Path $env:BUILD_SRC -Force | Out-Null; ` diff --git a/Dockerfiles/build-base/windows/Dockerfile_llvm_clang.agent2 b/Dockerfiles/build-base/windows/Dockerfile_llvm_clang.agent2 index ef2817143..36cc2399b 100644 --- a/Dockerfiles/build-base/windows/Dockerfile_llvm_clang.agent2 +++ b/Dockerfiles/build-base/windows/Dockerfile_llvm_clang.agent2 @@ -41,7 +41,7 @@ LABEL org.opencontainers.image.title="Zabbix agent 2 build base for Windows" ` SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] RUN Set-Location -Path $env:SystemDrive\.; ` - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13; ` + [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}\msys64\usr\bin;{0}\msys64\clang64\bin', $env:SystemDrive); ` @@ -141,7 +141,7 @@ RUN Set-Location -Path $env:SystemDrive\.; ` Remove-Item -Force -Recurse $env:TEMP\*; ` Write-Host 'Build environment is ready...'; ` ` - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13; ` + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; ` ` New-Item -ItemType directory -Path $env:BUILD_OUTPUT -Force | Out-Null; ` New-Item -ItemType directory -Path $env:BUILD_SRC -Force | Out-Null; ` diff --git a/Dockerfiles/build-base/windows/Dockerfile_msvcrt.agent2 b/Dockerfiles/build-base/windows/Dockerfile_msvcrt.agent2 index 8fe4c1042..d6bc304a1 100644 --- a/Dockerfiles/build-base/windows/Dockerfile_msvcrt.agent2 +++ b/Dockerfiles/build-base/windows/Dockerfile_msvcrt.agent2 @@ -44,7 +44,7 @@ LABEL org.opencontainers.image.title="Zabbix agent 2 build base for Windows" ` SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] RUN Set-Location -Path $env:SystemDrive\.; ` - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13; ` + [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}\msys64\usr\bin;{0}\msys64\ucrt64\bin;{0}\msys64\mingw64\bin', $env:SystemDrive); ` @@ -181,7 +181,7 @@ RUN Set-Location -Path $env:SystemDrive\.; ` Remove-Item -Force -Recurse $env:TEMP\*; ` Write-Host 'Build environment is ready...'; ` Set-Location -Path $env:SystemDrive\.; ` - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13; ` + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; ` ` New-Item -ItemType directory -Path $env:BUILD_OUTPUT -Force | Out-Null; ` New-Item -ItemType directory -Path $env:BUILD_SRC -Force | Out-Null; ` diff --git a/Dockerfiles/build-base/windows/Dockerfile_vcpkg.agent2 b/Dockerfiles/build-base/windows/Dockerfile_vcpkg.agent2 index 349d8a3da..7553f46b8 100644 --- a/Dockerfiles/build-base/windows/Dockerfile_vcpkg.agent2 +++ b/Dockerfiles/build-base/windows/Dockerfile_vcpkg.agent2 @@ -36,7 +36,7 @@ LABEL org.opencontainers.image.title="Zabbix agent 2 build base for Windows" ` SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"] RUN Set-Location -Path $env:SystemDrive\.; ` - [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls13; ` + [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; ` ` $env:PATH = [string]::Format('{0}\vcpkg;{0}\llvm_mingw\bin;{0}\go\bin;{0}\git\cmd;{0}\git\mingw64\bin;{0}\git\usr\bin;', $env:SystemDrive, ${env:ProgramFiles}) + $env:PATH; ` [Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `