Docker demo
This demo runs Bee as a standalone host-level container. That is also the correct shape on a Docker Swarm node: Swarm services cannot request host PID mode, so run one independently managed Bee container on each node.
1. Download the definitions
Section titled “1. Download the definitions”mkdir bee-demo && cd bee-demo
curl -fsSLO https://obstack.it/downloads/bee/docker-compose.yamlcurl -fsSLO https://obstack.it/downloads/bee/bee.yamlcurl -fsSLO https://obstack.it/downloads/bee/vector.yamlcurl -fsSLO https://obstack.it/downloads/bee/otel-collector.yamlFirst ask for an evaluation license through an information request on www.obstack.it. Copy the signed file you receive into the directory:
install -m 0600 /path/to/your/license.json ./license.jsonPrepare the host mounts described in requirements, then pull the immutable version used by the definitions:
docker pull obstackit/bee:0.3.02. Choose one collector
Section titled “2. Choose one collector”The Compose file uses profiles because Vector and the OpenTelemetry Collector both listen on the node’s 127.0.0.1:4318. Start exactly one.
Vector
Section titled “Vector”sudo docker compose --profile vector up -dOpenTelemetry Collector
Section titled “OpenTelemetry Collector”sudo docker compose --profile otel up -dBee may start before the collector. That is safe: its exporter reconnects and its bounded disk ring retains eligible batches while the receiver is unavailable.
3. Generate traffic
Section titled “3. Generate traffic”The stack includes a Python HTTP service named bee-demo:
for request in 1 2 3; do curl -fsS "http://127.0.0.1:18080/?request=${request}" >/dev/nulldoneWait a few seconds for batching, then inspect the selected collector.
For Vector:
sudo docker compose logs --since 1m vectorsudo docker compose exec vector tail -n 5 /var/lib/vector/bee-traces.jsonFor the OpenTelemetry Collector:
sudo docker compose logs --since 1m otel-collectorThe output should include an HTTP SERVER span and service.name=bee-demo.
4. Check Bee itself
Section titled “4. Check Bee itself”curl -fsS http://127.0.0.1:9400/livezcurl -fsS http://127.0.0.1:9400/readyzcurl -fsS http://127.0.0.1:9400/metrics \ | grep -E '^obstack_bee_(collector_connected|ebpf_packets_total|spans_exported_total) 'curl -fsS http://127.0.0.1:9400/graph | python3 -m json.toolExpected values after traffic:
obstack_bee_collector_connected 1obstack_bee_ebpf_packets_total <non-zero>obstack_bee_spans_exported_total <non-zero>What the Compose definition preserves
Section titled “What the Compose definition preserves”The downloadable definition includes the parts that tend to disappear from shortened examples:
- host PID, network, cgroup, and UTS namespaces;
- host
/proc, cgroup v2, bpffs, tracefs, machine ID, and optional Docker socket; - a disk-backed
/var/lib/obstack-beedirectory; nofile=131072and unlimited legacy memlock;- one CPU and 768 MiB memory/swap ceilings;
- bounded Docker logs and a 10-minute graceful stop allowance;
- the ordinary
runcruntime, so Bee is not injected into its own container.
Do not convert Bee into a Swarm service. Install the same Compose definition or an equivalent docker run command once on each Swarm node.
Stop or replace Bee
Section titled “Stop or replace Bee”Probe teardown can take minutes on a busy host. Stop gracefully and allow the configured ten minutes:
sudo docker compose stop -t 600 beesudo docker compose downAvoid docker rm -f during upgrades. Start the replacement only after the old container has exited and port 9400 is free.