Updated build process for Zabbix agent (windows)

This commit is contained in:
Alexey Pustovalov 2024-05-17 13:40:49 +00:00
parent 9d6d6d20bf
commit 967b97a602
3 changed files with 10 additions and 10 deletions

View File

@ -28,7 +28,7 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop';"]
WORKDIR C:\zabbix\
COPY --from=builder ["C:\\zabbix", "C:\\zabbix"]
COPY --from=builder ["C:\\zabbix_output", "C:\\zabbix"]
COPY [".\\docker-entrypoint.ps1", "C:\\zabbix"]
USER ContainerAdministrator
@ -37,7 +37,10 @@ RUN $env:PATH = [string]::Format('{0}\zabbix\sbin;{0}\zabbix\bin;', $env:SystemD
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
`
$env:ZBX_HOME = [string]::Format('{0}\zabbix', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('ZBX_HOME', $env:ZBX_HOME, [EnvironmentVariableTarget]::Machine);
[Environment]::SetEnvironmentVariable('ZBX_HOME', $env:ZBX_HOME, [EnvironmentVariableTarget]::Machine); `
`
Write-Host ('Verifying Zabbix agent 2 {0} ...' -f $env:ZBX_VERSION); `
zabbix_agentd.exe -V;
RUN Set-Location -Path $env:SystemDrive\.; `
`

View File

@ -28,7 +28,7 @@ SHELL ["pwsh", "-Command", "$ErrorActionPreference = 'Stop';"]
WORKDIR C:\zabbix\
COPY --from=builder ["C:\\zabbix2", "C:\\zabbix"]
COPY --from=builder ["C:\\zabbix_output", "C:\\zabbix"]
COPY --from=builder ["C:\\mongodb_plugin\\zabbix-agent2-plugin-mongodb.exe", "C:\\zabbix\\zabbix-agent2-plugin\\zabbix-agent2-plugin-mongodb.exe"]
COPY --from=builder ["C:\\mongodb_plugin\\mongodb.conf", "C:\\zabbix\\conf\\zabbix_agentd.d\\mongodb.conf"]
COPY --from=builder ["C:\\postgresql_plugin\\zabbix-agent2-plugin-postgresql.exe", "C:\\zabbix\\zabbix-agent2-plugin\\zabbix-agent2-plugin-postgresql.exe"]
@ -41,7 +41,10 @@ RUN $env:PATH = [string]::Format('{0}\zabbix\sbin;{0}\zabbix\bin;', $env:SystemD
[Environment]::SetEnvironmentVariable('PATH', $env:PATH, [EnvironmentVariableTarget]::Machine); `
`
$env:ZBX_HOME = [string]::Format('{0}\zabbix', $env:SystemDrive); `
[Environment]::SetEnvironmentVariable('ZBX_HOME', $env:ZBX_HOME, [EnvironmentVariableTarget]::Machine);
[Environment]::SetEnvironmentVariable('ZBX_HOME', $env:ZBX_HOME, [EnvironmentVariableTarget]::Machine); `
`
Write-Host ('Verifying Zabbix agent 2 {0} ...' -f $env:ZBX_VERSION); `
zabbix_agent2.exe -V;
RUN Set-Location -Path $env:SystemDrive\.; `
`

View File

@ -93,12 +93,6 @@ RUN Set-Location -Path $env:SystemDrive\.; `
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 'Installing Go Lang...'; `
Expand-Archive -Path $env:TEMP\go-amd64.zip -DestinationPath $env:SystemDrive\; `
`