From 5131f9fcbc39d6365a746fdfeb92f776d4800b3c Mon Sep 17 00:00:00 2001 From: Alexey Pustovalov Date: Wed, 23 Oct 2024 00:14:13 +0900 Subject: [PATCH] Fixed build on RHEL and OEL --- Dockerfiles/build-mysql/ol/Dockerfile | 3 +++ Dockerfiles/build-mysql/rhel/Dockerfile | 3 +++ Dockerfiles/build-pgsql/ol/Dockerfile | 3 +++ Dockerfiles/build-pgsql/rhel/Dockerfile | 3 +++ 4 files changed, 12 insertions(+) diff --git a/Dockerfiles/build-mysql/ol/Dockerfile b/Dockerfiles/build-mysql/ol/Dockerfile index ef3b2ae6e..d44d743ee 100644 --- a/Dockerfiles/build-mysql/ol/Dockerfile +++ b/Dockerfiles/build-mysql/ol/Dockerfile @@ -136,6 +136,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ mkdir -p ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \ git -c advice.detachedHead=false clone ${MONGODB_PLUGIN_SOURCES} --branch ${MONGODB_PLUGIN_VERSION} --depth 1 --single-branch /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION} && \ cd /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION} && \ + sed -i 's/go 1.2[0-9]/go 1.21/g' go.mod && \ make && \ strip /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION}/zabbix-agent2-plugin-mongodb && \ cp /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION}/zabbix-agent2-plugin-mongodb ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/mongodb && \ @@ -143,6 +144,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ cd /tmp/ && \ git -c advice.detachedHead=false clone ${POSTGRESQL_PLUGIN_SOURCES} --branch ${POSTGRESQL_PLUGIN_VERSION} --depth 1 --single-branch /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION} && \ cd /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION} && \ + sed -i 's/go 1.2[0-9]/go 1.21/g' go.mod && \ make && \ strip /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION}/zabbix-agent2-plugin-postgresql && \ cp /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION}/zabbix-agent2-plugin-postgresql ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/postgresql && \ @@ -150,6 +152,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ cd /tmp/ && \ git -c advice.detachedHead=false clone ${MSSQL_PLUGIN_SOURCES} --branch ${MSSQL_PLUGIN_VERSION} --depth 1 --single-branch /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION} && \ cd /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION} && \ + sed -i 's/go 1.2[0-9]/go 1.21/g' go.mod && \ make && \ strip /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION}/zabbix-agent2-plugin-mssql && \ cp /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION}/zabbix-agent2-plugin-mssql ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/mssql && \ diff --git a/Dockerfiles/build-mysql/rhel/Dockerfile b/Dockerfiles/build-mysql/rhel/Dockerfile index f88a29849..c4e47ad8d 100644 --- a/Dockerfiles/build-mysql/rhel/Dockerfile +++ b/Dockerfiles/build-mysql/rhel/Dockerfile @@ -146,6 +146,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ mkdir -p ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \ git -c advice.detachedHead=false clone ${MONGODB_PLUGIN_SOURCES} --branch ${MONGODB_PLUGIN_VERSION} --depth 1 --single-branch /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION} && \ cd /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION} && \ + sed -i 's/go 1.2[0-9]/go 1.21/g' go.mod && \ make && \ strip /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION}/zabbix-agent2-plugin-mongodb && \ cp /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION}/zabbix-agent2-plugin-mongodb ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/mongodb && \ @@ -153,6 +154,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ cd /tmp/ && \ git -c advice.detachedHead=false clone ${POSTGRESQL_PLUGIN_SOURCES} --branch ${POSTGRESQL_PLUGIN_VERSION} --depth 1 --single-branch /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION} && \ cd /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION} && \ + sed -i 's/go 1.2[0-9]/go 1.21/g' go.mod && \ make && \ strip /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION}/zabbix-agent2-plugin-postgresql && \ cp /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION}/zabbix-agent2-plugin-postgresql ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/postgresql && \ @@ -160,6 +162,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ cd /tmp/ && \ git -c advice.detachedHead=false clone ${MSSQL_PLUGIN_SOURCES} --branch ${MSSQL_PLUGIN_VERSION} --depth 1 --single-branch /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION} && \ cd /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION} && \ + sed -i 's/go 1.2[0-9]/go 1.21/g' go.mod && \ make && \ strip /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION}/zabbix-agent2-plugin-mssql && \ cp /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION}/zabbix-agent2-plugin-mssql ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/mssql && \ diff --git a/Dockerfiles/build-pgsql/ol/Dockerfile b/Dockerfiles/build-pgsql/ol/Dockerfile index 931bb6c7f..92dc125c8 100644 --- a/Dockerfiles/build-pgsql/ol/Dockerfile +++ b/Dockerfiles/build-pgsql/ol/Dockerfile @@ -141,6 +141,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ mkdir -p ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \ git -c advice.detachedHead=false clone ${MONGODB_PLUGIN_SOURCES} --branch ${MONGODB_PLUGIN_VERSION} --depth 1 --single-branch /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION} && \ cd /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION} && \ + sed -i 's/go 1.2[0-9]/go 1.21/g' go.mod && \ make && \ strip /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION}/zabbix-agent2-plugin-mongodb && \ cp /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION}/zabbix-agent2-plugin-mongodb ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/mongodb && \ @@ -148,6 +149,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ cd /tmp/ && \ git -c advice.detachedHead=false clone ${POSTGRESQL_PLUGIN_SOURCES} --branch ${POSTGRESQL_PLUGIN_VERSION} --depth 1 --single-branch /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION} && \ cd /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION} && \ + sed -i 's/go 1.2[0-9]/go 1.21/g' go.mod && \ make && \ strip /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION}/zabbix-agent2-plugin-postgresql && \ cp /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION}/zabbix-agent2-plugin-postgresql ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/postgresql && \ @@ -155,6 +157,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ cd /tmp/ && \ git -c advice.detachedHead=false clone ${MSSQL_PLUGIN_SOURCES} --branch ${MSSQL_PLUGIN_VERSION} --depth 1 --single-branch /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION} && \ cd /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION} && \ + sed -i 's/go 1.2[0-9]/go 1.21/g' go.mod && \ make && \ strip /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION}/zabbix-agent2-plugin-mssql && \ cp /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION}/zabbix-agent2-plugin-mssql ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/mssql && \ diff --git a/Dockerfiles/build-pgsql/rhel/Dockerfile b/Dockerfiles/build-pgsql/rhel/Dockerfile index 8f5846844..75bfd6283 100644 --- a/Dockerfiles/build-pgsql/rhel/Dockerfile +++ b/Dockerfiles/build-pgsql/rhel/Dockerfile @@ -151,6 +151,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ mkdir -p ${ZBX_OUTPUT_DIR}/agent2/conf/zabbix_agent2.d/plugins.d/ && \ git -c advice.detachedHead=false clone ${MONGODB_PLUGIN_SOURCES} --branch ${MONGODB_PLUGIN_VERSION} --depth 1 --single-branch /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION} && \ cd /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION} && \ + sed -i 's/go 1.2[0-9]/go 1.21/g' go.mod && \ make && \ strip /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION}/zabbix-agent2-plugin-mongodb && \ cp /tmp/mongodb-plugin-${MONGODB_PLUGIN_VERSION}/zabbix-agent2-plugin-mongodb ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/mongodb && \ @@ -158,6 +159,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ cd /tmp/ && \ git -c advice.detachedHead=false clone ${POSTGRESQL_PLUGIN_SOURCES} --branch ${POSTGRESQL_PLUGIN_VERSION} --depth 1 --single-branch /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION} && \ cd /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION} && \ + sed -i 's/go 1.2[0-9]/go 1.21/g' go.mod && \ make && \ strip /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION}/zabbix-agent2-plugin-postgresql && \ cp /tmp/postgresql-plugin-${POSTGRESQL_PLUGIN_VERSION}/zabbix-agent2-plugin-postgresql ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/postgresql && \ @@ -165,6 +167,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build/ \ cd /tmp/ && \ git -c advice.detachedHead=false clone ${MSSQL_PLUGIN_SOURCES} --branch ${MSSQL_PLUGIN_VERSION} --depth 1 --single-branch /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION} && \ cd /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION} && \ + sed -i 's/go 1.2[0-9]/go 1.21/g' go.mod && \ make && \ strip /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION}/zabbix-agent2-plugin-mssql && \ cp /tmp/mssql-plugin-${MSSQL_PLUGIN_VERSION}/zabbix-agent2-plugin-mssql ${ZBX_OUTPUT_DIR}/agent2/sbin/zabbix-agent2-plugin/mssql && \