nats official docker image

NATS is an open-source, high-performance, cloud native messaging system.

Supported tags and respective Dockerfile links

For more information about this image and its history, please see the relevant manifest file (library/nats) in the docker-library/official-images GitHub repo.

NATS: A high-performance cloud native messaging system.

logo

nats is a high performance server for the NATS Messaging System.

Example usage

# 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 nats
[1] 2015/08/08 02:18:59.240582 [INF] Starting gnatsd version 0.6.4
[1] 2015/08/08 02:18:59.240694 [INF] Starting http monitor on port 8222
[1] 2015/08/08 02:18:59.240708 [INF] Listening for route connections on 0.0.0.0:6222
[1] 2015/08/08 02:18:59.240801 [INF] Listening for client connections on 0.0.0.0:4222
[1] 2015/08/08 02:18:59.240823 [INF] gnatsd is ready

...

# To run a second server and cluster them together..
$ docker run -d --name=nats-2 --link nats-main nats --routes=nats-route://ruser:T0pS3cr3t@nats-main:6222

# If you want to verify the routes are connected, try
$ docker run -d --name=nats-2 --link nats-main nats --routes=nats-route://ruser:T0pS3cr3t@nats-main:6222 -DV
[1] 2015/08/08 06:06:18.662453 [INF] Starting gnatsd version 0.6.4
[1] 2015/08/08 06:06:18.662524 [INF] Starting http monitor on port 8222
[1] 2015/08/08 06:06:18.662680 [INF] Listening for route connections on :6222
[1] 2015/08/08 06:06:18.662807 [INF] Listening for client connections on 0.0.0.0:4222
[1] 2015/08/08 06:06:18.662831 [INF] gnatsd is ready
[1] 2015/08/08 06:06:18.662862 [DBG] Trying to connect to route on nats-main:6222
[1] 2015/08/08 06:06:18.663579 [DBG] 172.17.0.52:6222 - rid:1 - Route connection created
[1] 2015/08/08 06:06:18.663647 [DBG] 172.17.0.52:6222 - rid:1 - Route connect msg sent
[1] 2015/08/08 06:06:18.664040 [DBG] 172.17.0.52:6222 - rid:1 - Registering remote route "ee35d227433a738c729f9422a59667bb"
[1] 2015/08/08 06:06:18.664133 [DBG] 172.17.0.52:6222 - rid:1 - Route sent local subscriptions

The server will load the configuration file below. Any command line flags can override these values.

Default Configuration File

# Client port of 4222 on all interfaces
port: 4222

# HTTP monitoring port
monitor_port: 8222

# This is for clustering multiple servers together.
cluster {

  # Route connections to be received on any interface on port 6222
  port: 6222

  # Routes are protected, so need to use them with --routes flag
  # e.g. --routes=nats-route://ruser:T0pS3cr3t@otherdockerhost:6222
  authorization {
    user: ruser
    password: T0pS3cr3t
    timeout: 0.75
  }

  # Routes are actively solicited and connected to from this server.
  # This Docker image has none by default, but you can pass a
  # flag to the gnatsd docker image to create one to an existing server.
  routes = []
}

Commandline Options

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
    -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

Cluster Options:
        --routes [rurl-1, rurl-2]    Routes to solicit and connect

Common Options:
    -h, --help                       Show this message
    -v, --version                    Show version

License

View license information for the software contained in this image.

Supported Docker versions

This image is officially supported on Docker version 1.8.1.

Support for older versions (down to 1.0) is provided on a best-effort basis.

 


Docker, Inc is the company behind the open source Docker platform and the growing Docker ecosystem of contributors, partners and adopters revolutionizing the way distributed applications are built, shipped, and run.



Website: docker.com

Docker Registery: Nats Official Docker Image




Copyright (c) 2014-2015 Docker, Inc.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


Login to View or Leave Comments

Container
Converse with your fellow Users in the Automic Community.

Updated:
August 13, 2015