Fixed build on RHEL and OEL

This commit is contained in:
Alexey Pustovalov 2024-10-23 12:46:57 +09:00
parent 4efd640495
commit a9d4db1299
2 changed files with 6 additions and 0 deletions

View File

@ -113,6 +113,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 && \
@ -120,6 +121,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 && \
@ -127,6 +129,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 && \

View File

@ -123,6 +123,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 && \
@ -130,6 +131,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 && \
@ -137,6 +139,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 && \