2021-09-17 22:35:50 +02:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
# escape=`
|
2021-11-13 01:27:21 +01:00
|
|
|
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022
|
2021-09-17 22:35:50 +02:00
|
|
|
FROM $BUILD_BASE_IMAGE as builder_base
|
|
|
|
|
2024-05-16 21:05:20 +02:00
|
|
|
ARG PCRE2_VERSION=10.43
|
|
|
|
ARG OPENSSL_VERSION=3.3.0
|
|
|
|
ARG GOLANG_VERSION=1.22.3
|
2024-05-18 06:55:00 +02:00
|
|
|
ARG SEVEN_ZIP_VERSION=2405
|
|
|
|
|
2021-09-17 22:35:50 +02:00
|
|
|
ARG BUILD_ARCH=x64
|
|
|
|
ARG CPU_MODEL=AMD64
|
|
|
|
|
2023-03-07 09:07:13 +01:00
|
|
|
ARG MAJOR_VERSION=7.0
|
2021-09-17 22:35:50 +02:00
|
|
|
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
|
2024-05-18 06:55:00 +02:00
|
|
|
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
|
2024-05-16 21:05:20 +02:00
|
|
|
ARG GOLANG_URL=https://go.dev/dl/go$GOLANG_VERSION.windows-amd64.zip
|
|
|
|
ARG MSYS2_URL=https://repo.msys2.org/distrib/x86_64/msys2-base-x86_64-20240507.sfx.exe
|
2024-05-18 06:55:00 +02:00
|
|
|
|
2022-01-21 21:56:51 +01:00
|
|
|
ARG PCRE2_URL=https://github.com/PhilipHazel/pcre2/releases/download/pcre2-$PCRE2_VERSION/pcre2-$PCRE2_VERSION.zip
|
2021-09-17 22:35:50 +02:00
|
|
|
ARG OPENSSL_URL=https://www.openssl.org/source/openssl-$OPENSSL_VERSION.tar.gz
|
|
|
|
|
2021-10-16 17:49:19 +02:00
|
|
|
ENV ZBX_VERSION=$ZBX_VERSION `
|
|
|
|
BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL `
|
2024-05-18 06:55:00 +02:00
|
|
|
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 `
|
2022-01-21 21:56:51 +01:00
|
|
|
PCRE2_VERSION=$PCRE2_VERSION OPENSSL_VERSION=$OPENSSL_VERSION `
|
2024-05-18 06:55:00 +02:00
|
|
|
PCRE2_URL=$PCRE2_URL OPENSSL_URL=$OPENSSL_URL
|
2021-09-17 22:35:50 +02:00
|
|
|
|
2021-09-18 03:08:26 +02:00
|
|
|
LABEL org.opencontainers.image.title="Zabbix agent 2 build base for Windows" `
|
|
|
|
org.opencontainers.image.authors="Alexey Pustovalov <alexey.pustovalov@zabbix.com>" `
|
2024-05-13 19:31:38 +02:00
|
|
|
org.opencontainers.image.vendor="Zabbix SIA" `
|
2021-09-18 03:08:26 +02:00
|
|
|
org.opencontainers.image.url="https://zabbix.com/" `
|
|
|
|
org.opencontainers.image.description="Zabbix build base image contains all required packages to build Zabbix agent 2 images" `
|
2024-05-13 19:31:38 +02:00
|
|
|
org.opencontainers.image.licenses="AGPL v3.0" `
|
2021-09-18 03:08:26 +02:00
|
|
|
org.opencontainers.image.documentation="https://www.zabbix.com/documentation/${MAJOR_VERSION}/manual/installation/containers" `
|
2021-10-16 17:49:19 +02:00
|
|
|
org.opencontainers.image.version="${ZBX_VERSION}"
|
2021-09-17 22:35:50 +02:00
|
|
|
|
|
|
|
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
|
|
|
|
|
2024-05-20 19:18:46 +02:00
|
|
|
RUN [Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; `
|
2024-05-20 19:21:52 +02:00
|
|
|
Invoke-WebRequest -UseBasicParsing -uri "https://github.com/msys2/msys2-installer/releases/download/nightly-x86_64/msys2-base-x86_64-latest.sfx.exe" -OutFile C:\msys2.exe; `
|
|
|
|
C:\msys2.exe -y -oC:\; `
|
2024-05-20 19:18:46 +02:00
|
|
|
Remove-Item msys2.exe ; `
|
|
|
|
function msys() { C:\msys64\usr\bin\bash.exe @('-lc') + @Args; } `
|
|
|
|
msys ' '; `
|
|
|
|
msys 'pacman --noconfirm -Syuu'; `
|
|
|
|
msys 'pacman --noconfirm -Syuu'; `
|
|
|
|
msys 'pacman --sync --quiet --noconfirm mingw-w64-ucrt-x86_64-cmake'; `
|
2024-05-20 19:28:26 +02:00
|
|
|
msys 'pacman --noconfirm -Scc'; `
|
|
|
|
taskkill /F /T;
|