NATS cloud native messaging system with automatic cluster configuration in Docker 1.12+ Swarm mode.
10K+
This image is updated via pull requests to the touchifyapp/docker-nats GitHub repo.

nats is a high performance server for the NATS Messaging System.
# Run a NATS server
# Each server exposes multiple ports
# 4222 is for clients.
# 8222 is an HTTP management port for information reporting.
# 6222 is a routing port for clustering.
# use -p or -P as needed.
$ docker run -d --name nats-main touchify/nats
# Create a network overlay
$ docker network create -d overlay events
# Run a NATS cluster.
# Use NATS_SERVICE_NAME variable to configure the cluster name.
$ docker service create \
$ --name nats-cluster \
$ --env NATS_SERVICE_NAME=nats-cluster \
$ --network events \
$ --replicas 3 \
$ touchify/nats
Cluster Options:
NATS_SERVICE_NAME For use in Docker 1.12 in Swarm mode.
Should equal to Docker service name in Swarm.
Used to configure the NATS cluster.
Cluster authentication Options :
NATS_CLUSTER_USER User for cluster authentication.
NATS_CLUSTER_PASSWORD Password for cluster authentication.
NATS_CLUSTER_TIMEOUT Timeout for cluster authentication.
Server Options:
-a, --addr HOST Bind to HOST address (default: 0.0.0.0)
-p, --port PORT Use PORT for clients (default: 4222)
-P, --pid FILE File to store PID
-m, --http_port PORT Use HTTP PORT for monitoring
-ms,--https_port PORT Use HTTPS PORT for monitoring
-c, --config FILE Configuration File
Logging Options:
-l, --log FILE File to redirect log output
-T, --logtime Timestamp log entries (default: true)
-s, --syslog Enable syslog as log method
-r, --remote_syslog Syslog server addr (udp://localhost:514)
-D, --debug Enable debugging output
-V, --trace Trace the raw protocol
-DV Debug and Trace
Authorization Options:
--user user User required for connections
--pass password Password required for connections
--auth <token> Authorization token required for connections
TLS Options:
--tls Enable TLS, do not verify clients (default: false)
--tlscert FILE Server certificate file
--tlskey FILE Private key for server certificate
--tlsverify Enable TLS, very client certificates
--tlscacert FILE Client certificate CA for verification
Cluster Options:
--routes <rurl-1, rurl-2> Routes to solicit and connect
--cluster <cluster-url> Cluster URL for solicited routes
--no_advertise <bool> Advertise known cluster IPs to clients
Common Options:
-h, --help Show this message
-v, --version Show version
--help_tls TLS help.
View license information for the software contained in this image.
This image is officially supported on Docker version 1.12+.
Please see the Docker installation documentation for details on how to upgrade your Docker daemon.
Documentation for this image is stored in the touchifyapp/docker-nats GitHub repo.
Be sure to familiarize yourself with the repository's README.md file before attempting a pull request.
If you have any problems with or questions about this image, please contact us through a GitHub issue.
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
Before you start to code, we recommend discussing your plans through a GitHub issue, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
Content type
Image
Digest
Size
5 MB
Last updated
about 10 years ago
docker pull touchify/nats