HUB
Sign inSign up
registrator logo

fayrus/registrator

Sponsored OSS

By Fayrus

•Updated about 7 hours ago

Registers Docker containers in Consul, etcd, CoreDNS, or ZooKeeper automatically

Image
Networking
1

10K+

fayrus/registrator repository overview

⁠Registrator

Registrator watches Docker events and keeps a service registry in sync: it registers containers when they start and deregisters them when they stop. Services are configured through SERVICE_* environment variables and labels, so application containers need no registration logic.

Maintained fork of gliderlabs/registrator⁠.

⁠Quick reference

⁠Which tag should I use?

Every release publishes four tags that point to the same image:

TagExampleMoves whenUse it for
vX.Y.Zv9.2.16NeverProduction. Reproducible deployments; upgrade deliberately.
vX.Yv9.2Each patch releaseReceiving fixes automatically within a minor version.
vXv9Each minor and patch releaseReceiving fixes and new features without breaking changes.
latestEvery release, including major versionsTrying Registrator out. Avoid in production.

All release tags are listed on the Tags⁠ page, and each release is described in the GitHub Releases⁠.

32-bit platforms: linux/arm/v7, linux/arm/v6, and linux/386 are no longer supported. v8.0.1 is the last image built for them and receives no further fixes. Still running one of these? Comment on #77⁠.

⁠Which backend should I use?

Pass the registry URI as the last argument. The scheme selects the backend:

Your registryURINotes
Consul service catalogconsul://localhost:8500Most common setup
Consul KV storeconsulkv://localhost:8500/<path>Writes plain key/value entries
etcd v3etcd://localhost:2379Recommended for etcd; supports TLS
etcd v2etcd-legacy://localhost:2379Legacy HTTP API only; no TLS
CoreDNS (etcd plugin)coredns://localhost:2379/skydns?zone=service.localReplaces the removed SkyDNS2 backend
ZooKeeperzookeeper://localhost:2181

-cleanup support differs per backend; see the cleanup support matrix⁠.

⁠Quick start

Registrator needs the Docker socket and usually host networking, so it can reach a local registry agent:

docker run -d \
  --name=registrator \
  --net=host \
  --volume=/var/run/docker.sock:/tmp/docker.sock \
  fayrus/registrator:v9 \
    consul://localhost:8500

Replace the URI with any backend from the table above. Then start a container with a published port:

docker run -d --name=redis -p 6379:6379 redis

Registrator registers redis in the configured backend and removes it when the container stops.

For backend-specific options (etcd TLS, multiple endpoints, CoreDNS zones), see the backend guides⁠.

⁠Common options

Options go before the registry URI:

OptionEffect
-ip=<addr>IP to register for ports mapped to the host
-internalRegister internal container ports instead of published ones
-explicitOnly register containers that set SERVICE_NAME
-cleanupRemove dangling services left by previous runs
-resync=<seconds>Periodically resynchronize all services
-ttl=<seconds> / -ttl-refresh=<seconds>Expire services unless refreshed
-retry-attempts=<n>Retry the backend connection at startup (-1 retries forever)

Per-container settings such as SERVICE_NAME, SERVICE_TAGS, and health checks are described in the configuration reference⁠.

⁠Image security

  • Runtime image: Chainguard static⁠, containing only the statically linked registrator binary; no shell or package manager.
  • Each release is built once, and every platform of that exact image is scanned with Trivy before any tag points to it; a release with fixable HIGH or CRITICAL vulnerabilities is not published. The runtime base digest is recorded in the org.opencontainers.image.base.digest label.
  • Go code, modules, and the toolchain are checked with govulncheck on every pull request and daily.
  • Report vulnerabilities privately as described in the security policy⁠.

⁠License

MIT. See LICENSE⁠.

Tag summary

Content type

Image

Digest

sha256:189c5c355…

Size

12.2 MB

Last updated

about 7 hours ago

docker pull fayrus/registrator

This week's pulls

Pulls:

581

Nov 9 to Nov 15