Docker Labels

Docker Labels

Define declarative tunnels using Docker container labels.


In Docker mode, rstream run --docker watches running containers and derives tunnel configuration from container labels. The model is intentionally similar to other label-driven ingress tools: the application containers declare the desired exposure, and a single agent reconciles tunnels.

Only labels with the rstream.tunnel. prefix are considered. Labels are grouped by tunnel name using the <name>.<key> pattern, and each tunnel group must define a forward label.

When a tunnel omits explicit values, the parser defaults publish=true and protocol=http.

Compose example

The example below runs the reconciler alongside two services. Each service declares a tunnel through labels.

services:
  rstream:
    image: rstream/rstream:latest
    command: ["rstream","run","--docker"]
    environment:
      RSTREAM_ENGINE: "<engine>"
      RSTREAM_AUTHENTICATION_TOKEN: "<token>"
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock
  api:
    image: my-api:latest
    labels:
      rstream.tunnel.api.forward: "8080"
      rstream.tunnel.api.publish: "true"
      rstream.tunnel.api.protocol: "http"
      rstream.tunnel.api.http.tokenAuth: "true"
  admin:
    image: my-admin:latest
    labels:
      rstream.tunnel.admin.forward: "9000"
      rstream.tunnel.admin.publish: "true"
      rstream.tunnel.admin.protocol: "http"
      rstream.tunnel.admin.auth.rstream: "true"

Label schema

The top-level keys under each tunnel name include forward, publish, protocol, type, host, trusted-ips, geoip, label.<key>, and nested keys under http.*, tls.*, and auth.*. Unknown keys are rejected.

The table below lists the most commonly used label keys.

LabelMeaning
rstream.tunnel.<name>.forwardUpstream target as port or host:port.
rstream.tunnel.<name>.publishWhether the tunnel is published.
rstream.tunnel.<name>.protocolTunnel protocol (http, tls, dtls, quic).
rstream.tunnel.<name>.label.<k>User-defined label attached to the tunnel.
rstream.tunnel.<name>.http.versionUpstream HTTP version (http/1.1, h2c, h3).
rstream.tunnel.<name>.http.upstreamTLSEnable TLS between engine and upstream.
rstream.tunnel.<name>.http.tokenAuthEnable token authentication.
rstream.tunnel.<name>.auth.rstreamEnable rstream auth.
rstream.tunnel.<name>.auth.challengeEnable challenge mode.