diff --git a/Dockerfiles/build-mysql/windows/Dockerfile.agent b/Dockerfiles/build-mysql/windows/Dockerfile.agent
index e648fc729..7bbf4e22f 100644
--- a/Dockerfiles/build-mysql/windows/Dockerfile.agent
+++ b/Dockerfiles/build-mysql/windows/Dockerfile.agent
@@ -70,5 +70,8 @@ RUN Set-Location -Path $env:SystemDrive\.; `
     Copy-Item -Path $env:ZBX_SOURCES_DIR\bin\win64\zabbix_get.exe $env:ZBX_OUTPUT_DIR\bin; `
     Copy-Item -Path $env:ZBX_SOURCES_DIR\bin\win64\zabbix_sender.exe $env:ZBX_OUTPUT_DIR\bin; `
     Copy-Item -Path $env:ZBX_SOURCES_DIR\conf\zabbix_agentd.win.conf $env:ZBX_OUTPUT_DIR\conf\zabbix_agentd.conf; `
-    nmake /S -f Makefile clean; `
+    nmake /S -f Makefile `
+        PCRE2INCDIR=$env:SystemDrive\build_output\pcre2\include `
+        PCRE2LIBDIR=$env:SystemDrive\build_output\pcre2\lib `
+        clean; `
     Write-Host 'Zabbix binaries are compiled...';