From dfd9a3895fac53b9a86b950225805765420424a4 Mon Sep 17 00:00:00 2001 From: Michael N Date: Thu, 14 Mar 2024 09:27:18 +0100 Subject: [PATCH] Build modules against same GLIBC as for official Nginx image (#587) Switch from ubuntu to debian for ci image to build binaries Switching from using Ubuntu to Debian for the CI image to build binaries is necessary because of compatibility issues with GLIBC versions. Currently, the docker image for nginx uses `debian:stable` as its base. However, latest nginx opentracing modules built on `ubuntu:23` has newer versions of GLIBC, causing problems when trying to use the nginx docker image to deploy the latest binaries on the release page. For example, when trying to integrate the latest release (v0.34.0) of nginx-opentracing with nginx Docker images, there are compatibility issues. nginx-opentracing v0.34.0 needs GLIBC 2.38, but nginx:1.25.4 has GLIBC 2.36, causing errors like: ``` The latest release (v0.34.0) of nginx-opentracing is no longer compatible with nginx's debian-based docker images. nginx-opentracing v0.34.0 requires GLIBC 2.38, while e.g. nginx:1.25.4 has GLIBC 2.36: ``` Switching to Debian as the standard base image will help prevent future problems with different GLIBC versions and make integration smoother. --- Makefile | 3 +++ build/Dockerfile | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 9c1bd131..eca27f2d 100644 --- a/Makefile +++ b/Makefile @@ -6,6 +6,9 @@ docker-image: docker-image-alpine: DOCKER_BUILDKIT=1 docker build -f Dockerfile -t opentracing-contrib/nginx-opentracing --target final --build-arg BUILD_OS=alpine . +docker-build-binaries: + DOCKER_BUILDKIT=1 docker buildx build --build-arg NGINX_VERSION=1.25.4 --platform linux/amd64 -f build/Dockerfile -t nginx-opentracing-binaries --target=export --output "type=local,dest=out" --progress=plain --no-cache --pull . + .PHONY: test test: ./ci/system_testing.sh diff --git a/build/Dockerfile b/build/Dockerfile index 8992e361..11cabcb2 100644 --- a/build/Dockerfile +++ b/build/Dockerfile @@ -1,4 +1,4 @@ -FROM ubuntu:23.10 as base +FROM debian:stable as base RUN apt-get update && \ apt-get install --no-install-recommends --no-install-suggests -y \