- Ajout de procps-ng dans les 4 Dockerfiles runtime (ps/pgrep disponibles) - Remplacement de pgrep par ps -C dans tous les run-tests.sh - Correction entrypoint nginx-varnish : pgrep nginx → cat nginx.pid (exit 127) - Activation HTTP/2 dans Varnish : ajout de -p feature=+http2 dans les entrypoints nginx-varnish et hitch-varnish - Restauration ALPN h2,http/1.1 dans hitch.conf (varnish supporte maintenant h2) - Correction healthcheck hitch-varnish : curl sans --http1.1 (h2 fonctionnel) - Correction requêtes phase_verify : http_logs_raw → http_logs, colonnes correctes - Correction writer clickhouse.go : noms JSON alignés avec la MV (ip_meta_*, tls_sni…) - Fix toStartOfSecond(DateTime) → toStartOfSecond(toDateTime64(col, 3)) - Retrait du SKIP el8/nginx-varnish (varnish s'installe bien sur AlmaLinux 8) Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
81 lines
2.5 KiB
Docker
81 lines
2.5 KiB
Docker
# =============================================================================
|
|
# Dockerfile — Construction multi-stage du démon ja4ebpf
|
|
# Stage 1 : compilation eBPF (Rocky Linux 9 + clang + bpftool)
|
|
# Stage 2 : compilation Go + génération des bindings bpf2go
|
|
# Stage 3 : image finale minimale (Rocky Linux 9 minimal)
|
|
# =============================================================================
|
|
|
|
# --- Stage 1 : eBPF builder ---
|
|
FROM rockylinux:9 AS ebpf-builder
|
|
|
|
# Installation des outils de compilation eBPF
|
|
# libbpf-devel est dans le dépôt CRB (CodeReady Builder) de Rocky Linux 9
|
|
RUN dnf install -y epel-release dnf-plugins-core && \
|
|
dnf config-manager --enable crb && \
|
|
dnf install -y \
|
|
clang \
|
|
llvm \
|
|
bpftool \
|
|
kernel-headers \
|
|
libbpf-devel \
|
|
make \
|
|
&& \
|
|
dnf clean all
|
|
|
|
WORKDIR /build
|
|
|
|
# Copier les sources eBPF
|
|
COPY services/ja4ebpf/bpf/ ./bpf/
|
|
|
|
# Créer le répertoire des headers et générer vmlinux.h depuis le BTF du kernel
|
|
RUN mkdir -p bpf/headers && \
|
|
bpftool btf dump file /sys/kernel/btf/vmlinux format c > bpf/headers/vmlinux.h 2>/dev/null || \
|
|
echo "/* vmlinux.h placeholder — généré au runtime */" > bpf/headers/vmlinux.h
|
|
|
|
# --- Stage 2 : Go builder ---
|
|
FROM rockylinux:9 AS go-builder
|
|
|
|
# Installation de Go et des outils nécessaires
|
|
# libbpf-devel est dans le dépôt CRB (CodeReady Builder) de Rocky Linux 9
|
|
RUN dnf install -y epel-release dnf-plugins-core && \
|
|
dnf config-manager --enable crb && \
|
|
dnf install -y \
|
|
golang \
|
|
clang \
|
|
llvm \
|
|
libbpf-devel \
|
|
kernel-headers \
|
|
bpftool \
|
|
make \
|
|
&& \
|
|
dnf clean all
|
|
|
|
WORKDIR /build
|
|
|
|
# Copier les headers eBPF générés au stage précédent
|
|
COPY --from=ebpf-builder /build/bpf/headers/ ./services/ja4ebpf/bpf/headers/
|
|
|
|
# Copier le workspace Go complet (nécessaire pour go.work)
|
|
COPY go.work go.work.sum ./
|
|
COPY shared/go/ja4common/ ./shared/go/ja4common/
|
|
COPY services/ja4ebpf/ ./services/ja4ebpf/
|
|
|
|
WORKDIR /build/services/ja4ebpf
|
|
|
|
# Générer les bindings Go depuis le bytecode eBPF
|
|
RUN go generate ./internal/loader/
|
|
|
|
# Compilation du binaire final
|
|
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /out/ja4ebpf ./cmd/ja4ebpf/
|
|
|
|
# --- Stage 3 : image finale ---
|
|
FROM rockylinux:9-minimal AS final
|
|
|
|
# Copier uniquement le binaire compilé
|
|
COPY --from=go-builder /out/ja4ebpf /usr/local/bin/ja4ebpf
|
|
|
|
# Créer le répertoire de configuration
|
|
RUN mkdir -p /etc/ja4ebpf
|
|
|
|
ENTRYPOINT ["/usr/local/bin/ja4ebpf"]
|