Skip to content

Commit 34373d2

Browse files
authored
Merge pull request #254 from coroot/build_on_older_debian
docker: use debian:bullseye instead of golang image to build with older glibc
2 parents c3fb0c6 + 41caad3 commit 34373d2

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

Dockerfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1-
FROM golang:1.24.7-trixie AS builder
2-
RUN apt update && apt install -y libsystemd-dev
1+
FROM debian:bullseye AS builder
2+
# Using Debian instead of the official Golang image because it’s based on newer OS versions
3+
# with newer glibc, which causes compatibility issues.
4+
5+
RUN apt-get update && apt-get install -y \
6+
curl git build-essential pkg-config libsystemd-dev
7+
8+
ARG GO_VERSION=1.24.9
9+
RUN curl -fsSL https://go.dev/dl/go${GO_VERSION}.linux-$(dpkg --print-architecture).tar.gz -o go.tar.gz && \
10+
tar -C /usr/local -xzf go.tar.gz && rm go.tar.gz
11+
ENV PATH="/usr/local/go/bin:${PATH}"
12+
313
WORKDIR /tmp/src
414
COPY go.mod .
515
COPY go.sum .

0 commit comments

Comments
 (0)