Cible: Rocky Linux 9 (compatible RHEL/CentOS)
Changes:
- packaging/Dockerfile.rpm: Build pour Rocky Linux
- packaging/build-rpm.sh: Ajout paramètre distribution (rocky/rhel/centos)
- packaging/rpm/ja4sentinel.spec:
* Condition %if 0%{?rhel} >= 8 pour compatibilité RHEL
* Description mise à jour avec Rocky Linux
- packaging/test/Dockerfile.rpm: Test sur Rocky Linux 9
- packaging/test/test-*.sh: Tests spécifiques Rocky Linux
- .github/workflows/build-rpm.yml:
* Nom du job: 'Build RPM Package (Rocky Linux)'
* TARGET_DIST: rockylinux:9
* Simplification du build via Docker
Documentation:
- README.md: Instructions d'installation pour .rpm (Rocky/RHEL) et .deb (Debian/Ubuntu)
- Remplacement des instructions de build par installation via packages
Compatibilité:
- Rocky Linux 8.x et 9.x
- RHEL 8.x et 9.x
- CentOS Stream 8 et 9
- AlmaLinux 8.x et 9.x
Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
36 lines
882 B
Docker
36 lines
882 B
Docker
# Dockerfile for building RPM packages for Rocky Linux
|
|
# Use Go 1.24 as base to ensure correct Go version
|
|
FROM golang:1.24-bookworm AS builder
|
|
|
|
# Install RPM build tools
|
|
RUN apt-get update && apt-get install -y \
|
|
rpm \
|
|
rpm-common \
|
|
rpm2cpio \
|
|
libpcap-dev \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build binary
|
|
ARG VERSION=1.0.0
|
|
RUN mkdir -p dist && \
|
|
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 \
|
|
go build -buildvcs=false -o dist/ja4sentinel-linux-amd64 ./cmd/ja4sentinel
|
|
|
|
# Build RPM for Rocky Linux (RHEL compatible)
|
|
ARG ARCH=x86_64
|
|
RUN mkdir -p /app/packages && \
|
|
./packaging/build-rpm.sh "${VERSION}" "${ARCH}" "rocky" && \
|
|
cp /app/build/rpm/*.rpm /app/packages/
|
|
|
|
# Final stage - minimal image with just the RPM
|
|
FROM alpine:latest
|
|
|
|
COPY --from=builder /app/packages/ /packages/
|
|
|
|
CMD ["ls", "-la", "/packages/"]
|