From 41caad3e5071357e9bc94f4253aee0231d9ef298 Mon Sep 17 00:00:00 2001 From: Nikolay Sivko Date: Thu, 16 Oct 2025 15:04:20 +0300 Subject: [PATCH] docker: use debian:bullseye instead of golang image to build with older glibc --- Dockerfile | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index da4e7e8..8d84d7e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,15 @@ -FROM golang:1.24.7-trixie AS builder -RUN apt update && apt install -y libsystemd-dev +FROM debian:bullseye AS builder +# Using Debian instead of the official Golang image because it’s based on newer OS versions +# with newer glibc, which causes compatibility issues. + +RUN apt-get update && apt-get install -y \ + curl git build-essential pkg-config libsystemd-dev + +ARG GO_VERSION=1.24.9 +RUN curl -fsSL https://go.dev/dl/go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz -o go.tar.gz && \ + tar -C /usr/local -xzf go.tar.gz && rm go.tar.gz +ENV PATH="/usr/local/go/bin:${PATH}" + WORKDIR /tmp/src COPY go.mod . COPY go.sum .