Skip to content

Commit

Permalink
Updated build procedure for Windows containers
Browse files Browse the repository at this point in the history
  • Loading branch information
dotneft committed Jan 10, 2025
1 parent b0add34 commit a33d9ae
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 30 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/images_build_windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -249,15 +249,15 @@ jobs:
Write-Host @"
docker build --label org.opencontainers.image.revision=$Env:LABEL_REVISION
--label org.opencontainers.image.created=$Env:LABEL_CREATED
--build-arg=BUILD_BASE_IMAGE=$base_os_image
--build-arg=OS_BASE_IMAGE=$base_os_image
--file=$dockerfile
$tags
$context
"@
docker build --label org.opencontainers.image.revision=$Env:LABEL_REVISION `
--label org.opencontainers.image.created=$Env:LABEL_CREATED `
--build-arg=BUILD_BASE_IMAGE=$base_os_image `
--build-arg=OS_BASE_IMAGE=$base_os_image `
--file=$dockerfile `
$tags `
$context
Expand Down Expand Up @@ -717,7 +717,7 @@ jobs:
docker build --label org.opencontainers.image.revision=$Env:LABEL_REVISION
--label org.opencontainers.image.created=$Env:LABEL_CREATED
--build-arg=BUILD_BASE_IMAGE=$base_build_image
--build-arg=BASE_IMAGE=$base_image
--build-arg=OS_BASE_IMAGE=$base_image
--file=$dockerfile
$tags
$context
Expand All @@ -726,7 +726,7 @@ jobs:
docker build --label org.opencontainers.image.revision=$Env:LABEL_REVISION `
--label org.opencontainers.image.created=$Env:LABEL_CREATED `
--build-arg=BUILD_BASE_IMAGE=$base_build_image `
--build-arg=BASE_IMAGE=$base_image `
--build-arg=OS_BASE_IMAGE=$base_image `
--file=$dockerfile `
$tags `
$context
Expand Down
8 changes: 4 additions & 4 deletions Dockerfiles/agent/windows/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# syntax=docker/dockerfile:1
# escape=`
ARG OS_BASE_IMAGE=mcr.microsoft.com/powershell:lts-nanoserver-ltsc2022

ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG BUILD_BASE_IMAGE=zabbix-build-agent:ltsc2022-agent-${ZBX_VERSION}

ARG BASE_IMAGE=mcr.microsoft.com/powershell:lts-nanoserver-ltsc2022
ARG BUILD_BASE_IMAGE=zabbix-build-agent:ltsc2022-agent-${ZBX_VERSION}

FROM ${BUILD_BASE_IMAGE} AS builder

FROM ${BASE_IMAGE}
FROM ${OS_BASE_IMAGE}

ARG MAJOR_VERSION
ARG ZBX_VERSION
Expand Down
7 changes: 3 additions & 4 deletions Dockerfiles/agent2/windows/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
# syntax=docker/dockerfile:1
# escape=`
ARG OS_BASE_IMAGE=mcr.microsoft.com/powershell:lts-nanoserver-ltsc2022
ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG BUILD_BASE_IMAGE=zabbix-build-agent:ltsc2022-agent2-${ZBX_VERSION}

ARG BASE_IMAGE=mcr.microsoft.com/powershell:lts-nanoserver-ltsc2022
ARG BUILD_BASE_IMAGE=zabbix-build-agent:ltsc2022-agent2-${ZBX_VERSION}

FROM ${BUILD_BASE_IMAGE} AS builder

FROM ${BASE_IMAGE}
FROM ${OS_BASE_IMAGE}

ARG MAJOR_VERSION
ARG ZBX_VERSION
Expand Down
7 changes: 3 additions & 4 deletions Dockerfiles/build-base/windows/Dockerfile.agent
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1
# escape=`
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022
FROM $BUILD_BASE_IMAGE as builder_base
ARG OS_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022
FROM ${OS_BASE_IMAGE}

ARG PCRE2_VERSION=10.44
ARG OPENSSL_VERSION=3.3.2
Expand All @@ -10,7 +10,6 @@ ARG ZLIB_VERSION=1.3.1
ARG CURL_VERSION=8.11.1

ARG BUILD_ARCH=x64
ARG CPU_MODEL=AMD64

ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}
Expand All @@ -28,7 +27,7 @@ ARG ZLIB_URL=https://zlib.net/zlib-$ZLIB_VERSION.tar.gz
ARG CURL_URL=https://curl.se/download/curl-$CURL_VERSION.tar.gz

ENV ZBX_VERSION=$ZBX_VERSION `
BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL `
BUILD_ARCH=$BUILD_ARCH `
GIT_URL=$GIT_URL PERL_URL=$PERL_URL NASM_URL=$NASM_URL `
VS_BUILDTOOLS_URL=$VS_BUILDTOOLS_URL `
PCRE2_VERSION=$PCRE2_VERSION OPENSSL_VERSION=$OPENSSL_VERSION LIBMODBUS_VERSION=$LIBMODBUS_VERSION `
Expand Down
7 changes: 3 additions & 4 deletions Dockerfiles/build-base/windows/Dockerfile.agent2
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# syntax=docker/dockerfile:1
# escape=`
ARG BUILD_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022
FROM $BUILD_BASE_IMAGE as builder_base
ARG OS_BASE_IMAGE=mcr.microsoft.com/windows/servercore:ltsc2022
FROM ${OS_BASE_IMAGE}

ARG PCRE2_VERSION=10.44
ARG OPENSSL_VERSION=3.3.2
Expand All @@ -10,7 +10,6 @@ ARG GOLANG_VERSION=1.23.2
ARG MSYSTEM=UCRT64

ARG BUILD_ARCH=x64
ARG CPU_MODEL=AMD64

ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}
Expand All @@ -24,7 +23,7 @@ ARG PCRE2_URL=https://github.com/PhilipHazel/pcre2/releases/download/pcre2-$PCRE
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 `
BUILD_ARCH=$BUILD_ARCH `
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 `
Expand Down
3 changes: 1 addition & 2 deletions Dockerfiles/build-base/windows/Dockerfile_llvm_clang.agent2
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ ARG GOLANG_VERSION=1.23.2
ARG MSYSTEM=CLANG64

ARG BUILD_ARCH=x64
ARG CPU_MODEL=AMD64

ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}
Expand All @@ -23,7 +22,7 @@ ARG PCRE2_URL=https://github.com/PhilipHazel/pcre2/releases/download/pcre2-$PCRE
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 `
BUILD_ARCH=$BUILD_ARCH `
GOLANG_VERSION=$GOLANG_VERSION MSYS2_URL=$MSYS2_URL `
PCRE2_VERSION=$PCRE2_VERSION OPENSSL_VERSION=$OPENSSL_VERSION `
PCRE2_URL=$PCRE2_URL OPENSSL_URL=$OPENSSL_URL `
Expand Down
3 changes: 1 addition & 2 deletions Dockerfiles/build-base/windows/Dockerfile_msvcrt.agent2
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ ARG GOLANG_VERSION=1.23.2
ARG MSYSTEM=MINGW64

ARG BUILD_ARCH=x64
ARG CPU_MODEL=AMD64

ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}
Expand All @@ -24,7 +23,7 @@ ARG PCRE2_URL=https://github.com/PhilipHazel/pcre2/releases/download/pcre2-$PCRE
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 `
BUILD_ARCH=$BUILD_ARCH `
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 `
Expand Down
3 changes: 1 addition & 2 deletions Dockerfiles/build-base/windows/Dockerfile_vcpkg.agent2
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ FROM $BUILD_BASE_IMAGE as builder_base
ARG GOLANG_VERSION=1.23.2

ARG BUILD_ARCH=x64
ARG CPU_MODEL=AMD64

ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}
Expand All @@ -19,7 +18,7 @@ ARG LLVM_MINGW=https://github.com/mstorsjo/llvm-mingw/releases/download/20241030
ARG VCPKG_GIT=https://github.com/microsoft/vcpkg.git

ENV ZBX_VERSION=$ZBX_VERSION `
BUILD_ARCH=$BUILD_ARCH CPU_MODEL=$CPU_MODEL `
BUILD_ARCH=$BUILD_ARCH `
GIT_URL=$GIT_URL `
GOLANG_VERSION=$GOLANG_VERSION LLVM_MINGW=$LLVM_MINGW VCPKG_GIT=$VCPKG_GIT `
VCPKG_BINARY_SOURCES=clear VCPKG_DEFAULT_TRIPLET=$BUILD_ARCH-mingw-static-release
Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/build-mysql/windows/Dockerfile.agent
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG BUILD_BASE_IMAGE=zabbix-build-base:ltsc2022-agent-${ZBX_VERSION}

FROM ${BUILD_BASE_IMAGE} as builder
FROM ${BUILD_BASE_IMAGE} AS builder

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/build-mysql/windows/Dockerfile.agent2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG BUILD_BASE_IMAGE=zabbix-build-base:ltsc2022-agent2-${ZBX_VERSION}

FROM ${BUILD_BASE_IMAGE} as builder
FROM ${BUILD_BASE_IMAGE} AS builder

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG BUILD_BASE_IMAGE=zabbix-build-base:ltsc2022-agent2-${ZBX_VERSION}

FROM ${BUILD_BASE_IMAGE} as builder
FROM ${BUILD_BASE_IMAGE} AS builder

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

Expand Down
2 changes: 1 addition & 1 deletion Dockerfiles/build-mysql/windows/Dockerfile_vcpkg.agent2
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ ARG MAJOR_VERSION=7.4
ARG ZBX_VERSION=${MAJOR_VERSION}
ARG BUILD_BASE_IMAGE=zabbix-build-base:ltsc2022-agent2-${ZBX_VERSION}

FROM ${BUILD_BASE_IMAGE} as builder
FROM ${BUILD_BASE_IMAGE} AS builder

SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]

Expand Down

0 comments on commit a33d9ae

Please sign in to comment.