docktail

command module
v0.0.0-...-5006e19 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2026 License: AGPL-3.0 Imports: 14 Imported by: 0

README ΒΆ

🍸 DockTail

Unleash your containers as Tailscale Services.

DockTail Header

Featured on Tailscale Community

DockTail watches Docker containers, reads docktail.* labels, and exposes matching containers as Tailscale Services. App containers do not need published Docker ports by default; DockTail proxies directly to their Docker network IPs.

Why DockTail?

DockTail uses native Tailscale Services, not per-container Tailscale devices.

DockTail TSDProxy ScaleTail tsbridge Plain Services
Native Tailscale Services βœ… ❌ ❌ ❌ βœ…
Configured via Docker labels βœ… βœ… ❌ βœ… ❌
Apps do not consume separate Tailscale device slots βœ… ❌ ❌ ❌ βœ…
No app port publishing βœ… ⚠️¹ ⚠️² ⚠️¹ ⚠️³
Automatic Docker reconciliation βœ… βœ… ❌ βœ… ❌
Low manual setup after install βœ… βœ… ⚠️⁴ βœ… ❌
  • ΒΉ Depends on proxy and Docker network setup.
  • Β² Depends on the sidecar template and app network setup.
  • Β³ You configure how the service host reaches the backend yourself.
  • ⁴ ScaleTail is template-based, so each app usually starts from its own Compose recipe.

Features

  • Automatic Docker container discovery through labels.
  • Automatic Tailscale service creation with OAuth or API key credentials.
  • HTTP, HTTPS, TCP, and TLS-terminated TCP support.
  • Optional PROXY protocol on TCP services so backends see the tailnet client IP.
  • Tailscale HTTPS with automatic certificates.
  • Tailscale Funnel for public internet access.
  • Multiple Tailscale services from one container.
  • Automatic reconciliation when containers restart or IPs change.
  • Optional cleanup of unused Tailscale service definitions (opt-in, safe with multiple instances).
  • Stateless Docker container runtime.
  • Optional DockTail Cloud reporting β€” multi-host monitoring, opt-in via one env var.

Quick Start

services:
  docktail:
    image: ghcr.io/marvinvr/docktail:latest
    restart: unless-stopped
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - /var/run/tailscale:/var/run/tailscale
    environment:
      # Optional but recommended. Enables automatic service creation.
      - TAILSCALE_OAUTH_CLIENT_ID=${TAILSCALE_OAUTH_CLIENT_ID}
      - TAILSCALE_OAUTH_CLIENT_SECRET=${TAILSCALE_OAUTH_CLIENT_SECRET}

  myapp:
    image: nginx:latest
    # No ports needed. DockTail proxies directly to the container IP.
    labels:
      - "docktail.service.enable=true"
      - "docktail.service.name=myapp"
      - "docktail.service.port=80"
docker compose up -d
curl http://myapp.your-tailnet.ts.net

This assumes the Docker host is connected to Tailscale and allowed to advertise services. See the full docs for host setup, sidecar setup, rootless Docker, OAuth permissions, ACLs, labels, Funnel, and examples.

For Docker secrets or other mounted secret files, set FILE__TAILSCALE_OAUTH_CLIENT_ID / FILE__TAILSCALE_OAUTH_CLIENT_SECRET or TAILSCALE_OAUTH_CLIENT_ID_FILE / TAILSCALE_OAUTH_CLIENT_SECRET_FILE to the mounted file paths instead of putting the values directly in the environment.

Common Examples

Expose an app with Tailscale HTTPS:

labels:
  - "docktail.service.enable=true"
  - "docktail.service.name=api"
  - "docktail.service.port=3000"
  - "docktail.service.service-port=443"

Expose a database over TCP:

labels:
  - "docktail.service.enable=true"
  - "docktail.service.name=db"
  - "docktail.service.port=5432"
  - "docktail.service.protocol=tcp"
  - "docktail.service.service-port=5432"

Preserve the tailnet client IP on a TCP reverse proxy:

labels:
  - "docktail.service.enable=true"
  - "docktail.service.name=traefik"
  - "docktail.service.port=443"
  - "docktail.service.protocol=tcp"
  - "docktail.service.service-port=443"
  - "docktail.service.proxy-protocol=2"

Expose a service publicly with Tailscale Funnel:

labels:
  - "docktail.funnel.enable=true"
  - "docktail.funnel.port=3000"
  - "docktail.funnel.funnel-port=8443"

Mount an HTTP(S) Funnel at a path:

labels:
  - "docktail.funnel.enable=true"
  - "docktail.funnel.port=3000"
  - "docktail.funnel.path=/webhook"

DockTail Cloud (optional)

Once you run DockTail on more than one machine, "is it still up?" gets tedious. DockTail Cloud is a hosted dashboard for that β€” and because it already has the Docker and Tailscale context, it tells you which kind of broken you're looking at:

● down Β· OOM-killed                   β†’  Docker reported an OOM kill
● local up Β· awaiting approval        β†’  the app is fine, the exposure isn't
● host offline Β· heartbeat missing    β†’  the box stopped reporting

It rides along with the agent you already run β€” no second binary. Set one environment variable and the same container starts reporting:

environment:
  - DOCKTAIL_CLOUD_KEY=${DOCKTAIL_CLOUD_KEY}   # from cloud.docktail.org

Without the key the module is completely inert: no connection is opened and DockTail behaves exactly as before. The link is outbound-only and metadata-only β€” the protocol has no exec, deploy, or shell message types, which you can verify in cloud/.

Explore DockTail Cloud Β· open the dashboard Β· agent setup

Documentation

The canonical documentation source lives in docs/. The site at docktail.org is built from a separate repository, which pins this one as a submodule and renders those Markdown files with tools/docsgen at build time.

Build From Source

go build -o docktail .
docker build -t docktail:latest .

Star History

Star History Chart

License

AGPL v3


By @marvinvr

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis
Package cloud is DockTail's optional reporting module for DockTail Cloud.
Package cloud is DockTail's optional reporting module for DockTail Cloud.
proto
Package proto defines the wire contract between the DockTail agent (this repo, AGPL) and DockTail Cloud's proprietary agent-plane.
Package proto defines the wire contract between the DockTail agent (this repo, AGPL) and DockTail Cloud's proprietary agent-plane.
tools
docsgen command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL