feat(pipeline): add Docker path for the netflow pipeline toolchain - #98
Merged
Conversation
Adds a multi-stage Dockerfile and scripts/netflow-db-docker.sh so new users can run the pipeline with only Git and Docker installed, instead of rustup, a C toolchain, and the autotools stack. The image clones the nfdump fork at the superproject-pinned commit, so host submodules stay uninitialized. Also adds gcc and git to shell.nix so the Nix shell fully covers the native build, and documents the Docker path in docs/user.
Condenses the Docker prose to a command plus the two facts a user needs (capture-root mounting and output location). Replaces concrete example dates with <YYYY-MM-DD> placeholders across the docs so readers substitute a date their captures actually cover.
Splits the document into one-time setup (Docker or native) and shared usage, so the dataset, selection, configuration, and verification sections apply to both paths instead of reading as native-only. States the Docker substitution once and drops --nfdump from the examples, which removes the duplicated pipeline command and the per-section Docker footnotes.
This was referenced Aug 24, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Building a database today requires rustup, a C compiler, the full autotools stack (autoconf, automake, libtool, flex, bison, pkg-config), initialized git submodules, and a local build of the pinned nfdump fork. These are the most error-prone, platform-sensitive steps in new-user setup.
Solution
An optional Docker path for the pipeline only — the dashboard stays native (Bun + Node), since Cloudflare is the deploy target and a web container would have no production role.
Dockerfile— multi-stage onubuntu:24.04(matching CI). The builder clones the nfdump fork at the commit pinned by the superproject gitlink, passed as a build arg; a copied submodule checkout cannot work in a build context because its.gitis a pointer into the host repo. Runs the existingvendor/scripts/compile-nfdump.shunmodified, buildsnetflow-dbwithcargo build --locked --release, and ships a slim runtime with just the two binaries. The runtime stage re-runs smoke checks (netflow-db contract-version, nfdump-o atlantisno-match stream) so a broken image fails at build time.scripts/netflow-db-docker.sh— wrapper mirroringscripts/netflow-db.sh. Reads the pinned commit fromgit ls-tree, builds the image when missing (--buildto force), mountsdata/read-write anddatasets.jsonread-only at/workspace, mounts each--capture-rootread-only at its identical host path soroot_pathindatasets.jsonworks unchanged, and runs as the invoking uid:gid so outputs stay user-owned.shell.nix— addsgccandgit, making the Nix shell self-sufficient for the native nfdump build (verified below).Documentation
docs/user/setup-pipeline.mdis reorganized by phase rather than by path. It previously described Docker and native as parallel tracks, which duplicated thepipelinecommand and left shared knowledge — inclusive date semantics, MAAD defaults, flow selection, config mode, verification — sitting under headings marked "natively", where a Docker reader had no reason to keep reading.It now reads:
Choose a path(a table plus one substitution rule) →Docker setup/Native setup(one-time work) → shared usage sections that apply to both.--nfdumpno longer appears in any example; it lives in the native setup prose and the options table, which is what removed the duplicate command and the per-section Docker footnotes.Separately, concrete example dates are replaced with
<YYYY-MM-DD>placeholders across the docs (rootREADME.md,setup-pipeline.md,operations.md,querying.md,pipeline-contract.md) so readers substitute a date their captures actually cover.Flows to exercise
Expected: first run builds
atlantis-netflow-db:local(in-image smoke checks pass), the database lands atdata/<id>/netflow.sqliteowned by you, and the dashboard discovers it as before. No--nfdumpflag needed — the fork is the defaultnfdumpon PATH inside the image.Also worth a read-through of
docs/user/setup-pipeline.mdas a newcomer would: the Docker path should be followable end to end without bouncing into the native sections.Edge cases and decisions
--mountsyntax); the wrapper validates and errors clearly.data/— it is the only writable mount; a customdb_pathoutside it is not reachable in the container (documented).--capture-rootis only needed for commands that read captures (pipeline), not forverifyorcompare. Documented as one rule rather than a per-command note.Verification
Automated, on this branch:
bun run format,bun run lint,bun run typecheckall pass.16348e7+vendor/scripts/compile-nfdump.shin a bare tree — fullrunatlantis.shsuite green, both smoke checks pass, binary staged at the exact path the Dockerfile copies. Ran inside the updatednix-shell, which also proves thegcc/gitadditions complete that environment.cargo build --locked --releasefrom exactly the Dockerfile's COPY file set; the binary answerscontract-version→4.nix-instantiate shell.nixevaluates with the additions.#verify-the-output,#select-flows,#use-a-pipeline-configurationfromtroubleshooting.mdanddatasets.md) were checked before renaming headings; all still resolve.Remaining manual: the actual
docker buildcould not run on the authoring host (no docker-group access). On any Docker-enabled machine, run./scripts/netflow-db-docker.sh --build contract-version— expected output is4after the image builds (~15–30 min first time).Authored with Claude Code (Fable 5) as orchestrator; container implementation drafted by GPT-5.6-sol (xhigh reasoning) via codex, then reviewed and verified by the orchestrator.