|
| 1 | +# Docker |
| 2 | + |
| 3 | +bgpipe is published as a minimal, multi-architecture Docker image at `ghcr.io/bgpfix/bgpipe`. |
| 4 | + |
| 5 | +Available tags: |
| 6 | + |
| 7 | +- `latest` - latest build from `main` branch |
| 8 | +- `vX.Y.Z` - specific release |
| 9 | +- `vX.Y` - latest patch of a minor release |
| 10 | + |
| 11 | +## Quick Start |
| 12 | + |
| 13 | +```bash |
| 14 | +# print help |
| 15 | +docker run --rm ghcr.io/bgpfix/bgpipe:latest --help |
| 16 | + |
| 17 | +# find RPKI-invalid announcements in RIPE RIS live stream |
| 18 | +docker run --rm ghcr.io/bgpfix/bgpipe:latest -go \ |
| 19 | + -- ris-live \ |
| 20 | + -- rpki --invalid=keep \ |
| 21 | + -- grep 'tag[rpki/status] == INVALID' |
| 22 | +``` |
| 23 | + |
| 24 | +## Reading Files from the Host |
| 25 | + |
| 26 | +Mount a host directory to pass MRT files or capture output: |
| 27 | + |
| 28 | +```bash |
| 29 | +# read a local MRT file and write JSON output to the host |
| 30 | +docker run --rm \ |
| 31 | + -v /path/to/data:/data \ |
| 32 | + ghcr.io/bgpfix/bgpipe:latest \ |
| 33 | + -- read /data/updates.mrt \ |
| 34 | + -- write /data/output.json |
| 35 | +``` |
| 36 | + |
| 37 | +## BGP Sessions (Port Forwarding) |
| 38 | + |
| 39 | +To run bgpipe as a proxy accessible from the host or other containers, expose port 179: |
| 40 | + |
| 41 | +```bash |
| 42 | +# transparent proxy: host:1790 → bgpipe → 192.0.2.1:179 |
| 43 | +docker run --rm \ |
| 44 | + -p 1790:179 \ |
| 45 | + ghcr.io/bgpfix/bgpipe:latest \ |
| 46 | + -- listen :179 \ |
| 47 | + -- connect --wait "listen" 192.0.2.1 |
| 48 | +``` |
| 49 | + |
| 50 | +`--wait listen` tells the `connect` stage to wait until `listen` has accepted a connection before dialling out. This ensures the two halves of the proxy session are always synchronized. |
| 51 | + |
| 52 | +## Docker Compose Examples |
| 53 | + |
| 54 | +Docker Compose is included with [Docker Desktop](https://docs.docker.com/desktop/). To run any example below, save it as `compose.yml` in a new directory and run: |
| 55 | + |
| 56 | +```bash |
| 57 | +docker compose up # start (Ctrl+C to stop) |
| 58 | +docker compose down # clean up |
| 59 | +``` |
| 60 | + |
| 61 | +### RIS Live Monitoring |
| 62 | + |
| 63 | +The simplest example to try — no files or routers needed. Streams live BGP from [RIPE RIS Live](https://ris-live.ripe.net/) and prints matching routes to stdout: |
| 64 | + |
| 65 | +```yaml |
| 66 | +services: |
| 67 | + bgpipe: |
| 68 | + image: ghcr.io/bgpfix/bgpipe:latest |
| 69 | + command: >- |
| 70 | + -- ris-live |
| 71 | + -- grep 'prefix ~ 8.0.0.0/8' |
| 72 | + -- stdout |
| 73 | +``` |
| 74 | +
|
| 75 | +### MRT to JSON |
| 76 | +
|
| 77 | +Fetch a live MRT file from RIPE RIS and write it as JSON. The `read` stage handles URLs and gzip decompression automatically; the output JSON lands on the host via a volume mount: |
| 78 | + |
| 79 | +```yaml |
| 80 | +services: |
| 81 | + bgpipe: |
| 82 | + image: ghcr.io/bgpfix/bgpipe:latest |
| 83 | + volumes: |
| 84 | + - ./data:/data |
| 85 | + command: >- |
| 86 | + -- read https://data.ris.ripe.net/rrc01/2025.11/updates.20251107.2300.gz |
| 87 | + -- write /data/output.json |
| 88 | +``` |
| 89 | + |
| 90 | +```bash |
| 91 | +mkdir data |
| 92 | +docker compose up |
| 93 | +# output.json appears in ./data/ when done |
| 94 | +``` |
| 95 | + |
| 96 | +### RPKI Proxy with Routinator |
| 97 | + |
| 98 | +Run bgpipe as a RPKI-validating BGP proxy. [Routinator](https://routinator.docs.nlnetlabs.nl/) is an open-source RPKI validator by NLnet Labs that bgpipe connects to over RTR. |
| 99 | + |
| 100 | +```yaml |
| 101 | +services: |
| 102 | + routinator: |
| 103 | + image: nlnetlabs/routinator:latest |
| 104 | + command: server --rtr 0.0.0.0:3323 --http 0.0.0.0:8323 |
| 105 | +
|
| 106 | + bgpipe: |
| 107 | + image: ghcr.io/bgpfix/bgpipe:latest |
| 108 | + command: >- |
| 109 | + -- listen :179 |
| 110 | + -- rpki --rtr routinator:3323 |
| 111 | + -- connect --wait listen 192.0.2.1 |
| 112 | + ports: |
| 113 | + - "1790:179" |
| 114 | + depends_on: |
| 115 | + - routinator |
| 116 | +``` |
| 117 | + |
| 118 | +Replace `192.0.2.1` with the address of your downstream router. bgpipe listens on port 1790 on the host, accepts one BGP connection, and proxies it through RPKI validation before forwarding to the real router. |
| 119 | + |
| 120 | +## Building Locally |
| 121 | + |
| 122 | +The Dockerfile auto-detects the target platform, so a plain `docker build` produces the right image for your machine — no flags needed: |
| 123 | + |
| 124 | +```bash |
| 125 | +git clone https://github.com/bgpfix/bgpipe |
| 126 | +cd bgpipe |
| 127 | +docker build -t bgpipe . |
| 128 | +docker run --rm bgpipe --help |
| 129 | +``` |
| 130 | + |
| 131 | +To explicitly target a different platform: |
| 132 | + |
| 133 | +```bash |
| 134 | +docker build --platform linux/arm64 -t bgpipe . |
| 135 | +``` |
0 commit comments