fix: build correlator RPM on Rocky Linux instead of Debian
Replace golang:1.24 (Debian) builder with rockylinux:9 + dnf golang. All three RPM packages (sentinel, correlator, mod-reqin-log) now build entirely on Rocky Linux Docker images, ensuring native ABI compatibility. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
@ -2,19 +2,18 @@
|
||||
# =============================================================================
|
||||
# correlator — Dockerfile de packaging RPM (Rocky Linux 8/9, AlmaLinux 10)
|
||||
# Build context: monorepo root (ja4-platform/)
|
||||
# Méthode: 1 builder Go → 1 rpm-builder (rpmbuild, 3 × dist) → 1 output alpine
|
||||
# Méthode: 1 builder Rocky → 1 rpm-builder (rpmbuild, 3 × dist) → 1 output alpine
|
||||
# =============================================================================
|
||||
|
||||
# =============================================================================
|
||||
# Stage 1: Builder — compilation du binaire Go
|
||||
# golang:1.21 officiel (statiquement lié, CGO_ENABLED=0 → binaire portable)
|
||||
# Stage 1: Builder — compilation du binaire Go sur Rocky Linux 9
|
||||
# CGO_ENABLED=0 → binaire statique, mais compilé sur la même distro cible
|
||||
# =============================================================================
|
||||
FROM golang:1.24 AS builder
|
||||
FROM rockylinux:9 AS builder
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends git bc && \
|
||||
rm -rf /var/lib/apt/lists/*
|
||||
RUN dnf install -y golang git && dnf clean all
|
||||
|
||||
# Copie du workspace Go et du module partagé en premier (meilleur cache)
|
||||
COPY go.work go.work.sum* ./
|
||||
@ -23,13 +22,12 @@ COPY services/sentinel/go.mod services/sentinel/go.sum* ./services/sentinel/
|
||||
COPY services/correlator/go.mod services/correlator/go.sum* ./services/correlator/
|
||||
|
||||
WORKDIR /build/services/correlator
|
||||
RUN --mount=type=cache,target=/go/pkg/mod go mod download
|
||||
RUN go mod download
|
||||
|
||||
COPY services/correlator/ /build/services/correlator/
|
||||
|
||||
ARG VERSION=dev
|
||||
RUN --mount=type=cache,target=/go/pkg/mod \
|
||||
CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
|
||||
RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
|
||||
go build -ldflags="-w -s -X main.Version=${VERSION}" \
|
||||
-o /tmp/correlator \
|
||||
./cmd/logcorrelator
|
||||
|
||||
Reference in New Issue
Block a user