Files
ja4-platform/tests/integration/nginx/platform/Dockerfile
toto dc6ffd6474 fix: tests intégration matrix — procps-ng, varnish h2, hitch ALPN, pgrep→ps
- 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>
2026-04-12 01:29:01 +02:00

71 lines
2.6 KiB
Docker

# =============================================================================
# Platform nginx — Rocky Linux 9
# Construit ja4ebpf (eBPF CO-RE) + nginx avec HTTP/2 et TLS.
#
# Multi-stage :
# go-builder — compile ja4ebpf (go generate + go build) sur Rocky Linux
# runtime — nginx + binaire ja4ebpf sur Rocky Linux 9
# =============================================================================
# ARG global : doit être déclaré avant tous les FROM pour être utilisable
# dans les instructions FROM des stages suivants.
ARG BASE_IMAGE=rockylinux:9
# ── Stage 1 : build ja4ebpf (Rocky Linux, même toolchain que la prod) ─────────
FROM rockylinux:9 AS go-builder
# 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
COPY go.work go.work.sum* ./
COPY shared/go/ja4common/go.mod shared/go/ja4common/go.sum* ./shared/go/ja4common/
COPY services/ja4ebpf/go.mod services/ja4ebpf/go.sum* ./services/ja4ebpf/
RUN cd services/ja4ebpf && go mod download 2>/dev/null; true
COPY shared/go/ja4common/ ./shared/go/ja4common/
COPY services/ja4ebpf/ ./services/ja4ebpf/
WORKDIR /build/services/ja4ebpf
RUN GOWORK=off go generate ./internal/loader/ && \
GOWORK=off CGO_ENABLED=0 GOOS=linux GOARCH=amd64 \
go build -ldflags="-s -w" -o /out/ja4ebpf ./cmd/ja4ebpf/
# ── Stage 2 : runtime nginx + ja4ebpf ────────────────────────────────────────
FROM ${BASE_IMAGE}
RUN dnf install -y epel-release && \
dnf install -y --allowerasing procps-ng nginx openssl curl && \
dnf clean all
COPY --from=go-builder /out/ja4ebpf /usr/local/bin/ja4ebpf
# Configuration nginx : HTTP/2 + TLS auto-signé
RUN openssl req -x509 -nodes -days 365 \
-subj "/CN=platform.test" \
-newkey rsa:2048 \
-keyout /etc/pki/tls/private/nginx.key \
-out /etc/pki/tls/certs/nginx.crt && \
mkdir -p /var/www/html && \
echo '{"status":"ok","stack":"nginx"}' > /var/www/html/health && \
mkdir -p /var/log/nginx /run/nginx
COPY tests/integration/nginx/platform/nginx.conf /etc/nginx/nginx.conf
COPY tests/integration/nginx/platform/ja4ebpf.yml /etc/ja4ebpf/config.yml
COPY tests/integration/nginx/platform/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
EXPOSE 80 443
CMD ["/entrypoint.sh"]