Running Network Agent as a Docker Container

Nomatron is in early access. Some advanced workflows may not be covered in the public docs.

This page covers running the Network Agent from the published Docker image.

It is the right page for operators who want to:

  • run the agent on a long-lived Docker host inside a private network;
  • standardize delivery around OCI images instead of direct binaries; or
  • validate a container-based runtime before moving to Nomad scheduling.

The Network Agent is different from the Nomatron server in one important way: it is usually an outbound-only component. In most environments, you do not publish inbound ports from the container. Instead, the container must be able to:

  • reach the Nomatron server gRPC endpoint on port 4650;
  • reach the Nomatron server HTTP API on port 4649; and
  • reach the private Nomad API for every configured cluster.

Before You Start

Make sure these are already in place:

  • Docker is installed and the daemon is running;
  • the Network Agent config file is ready;
  • you have a valid Network Agent token;
  • the private network can reach Nomatron on 4650 and 4649; and
  • the container host can reach the private Nomad API for every configured cluster.

The published image for this release is:

text
ghcr.io/nomatronio/nomatron-releases/nomatron-connectivity-agent:v0.1.7

The image entrypoint is /usr/local/bin/nomatron-connectivity-agent, so arguments after the image name are passed straight to the agent.

Pull The Published Image

Pull a pinned release tag. Always pin a version tag such as v0.1.7; do not use latest:

bash
docker pull ghcr.io/nomatronio/nomatron-releases/nomatron-connectivity-agent:v0.1.7

Basic Container Start With A Mounted Config File

The simplest and most reliable runtime pattern is to mount the agent config file and the agent token file read-only. The config file points at the token with agent_token_file = "/etc/nomatron/agent-token":

bash
docker run --rm \
  -v /etc/nomatron/agent.hcl:/etc/nomatron/agent.hcl:ro \
  -v /etc/nomatron/agent-token:/etc/nomatron/agent-token:ro \
  ghcr.io/nomatronio/nomatron-releases/nomatron-connectivity-agent:v0.1.7 \
  --config /etc/nomatron/agent.hcl

This works well because the Network Agent expects most of its real configuration to come from the file, including:

  • server_addrs
  • http_base_urls
  • agent_id
  • agent_token_file (the path to the mounted token file; do not put the token inline)
  • cluster blocks
  • Nomad TLS settings
  • Nomad ACL token settings

If the config file references mounted CA files or client certificates, mount those into the container as well.

Example:

bash
docker run --rm \
  -v /etc/nomatron/agent.hcl:/etc/nomatron/agent.hcl:ro \
  -v /etc/nomatron/agent-token:/etc/nomatron/agent-token:ro \
  -v /etc/nomatron/ca.pem:/etc/nomatron/ca.pem:ro \
  ghcr.io/nomatronio/nomatron-releases/nomatron-connectivity-agent:v0.1.7 \
  --config /etc/nomatron/agent.hcl

Running With Environment Variable Overrides

You can override a small number of settings with environment variables when needed.

Example:

bash
docker run --rm \
  -v /etc/nomatron/agent.hcl:/etc/nomatron/agent.hcl:ro \
  -v /etc/nomatron/agent-token:/etc/nomatron/agent-token:ro \
  -e NOMATRON_AGENT_CONFIG=/etc/nomatron/agent.hcl \
  -e NOMATRON_AGENT_LOG_LEVEL=debug \
  ghcr.io/nomatronio/nomatron-releases/nomatron-connectivity-agent:v0.1.7

Useful overrides include:

  • NOMATRON_AGENT_CONFIG
  • NOMATRON_AGENT_SERVER_ADDR
  • NOMATRON_AGENT_HTTP_BASE_URL
  • NOMATRON_AGENT_ID
  • NOMATRON_CONNECTIVITY_AGENT_TOKEN (NOMATRON_AGENT_TOKEN is accepted as a fallback alias). If you use it, inject it with --env-file from a root-only file rather than -e on the command line.
  • NOMATRON_AGENT_LOG_LEVEL
  • NOMATRON_AGENT_LOG_FORMAT
  • NOMATRON_AGENT_HEARTBEAT_INTERVAL

Use overrides sparingly. The agent config file should still be the main source of truth for private-cluster connectivity.

What The Container Needs From Outside

Even though the agent runs inside Docker, the important dependencies still live outside the container:

  • the Nomatron control plane;
  • the private Nomad API for every configured cluster;
  • any TLS files or CA bundles you reference; and
  • any ACL token or Network Agent token injection path your platform uses.

The container image does not remove the need for correct private-network routing. It only changes the packaging and lifecycle model.

Ports And Networking

In most deployments, you do not need to publish any container ports.

That is because the Network Agent:

  • opens outbound gRPC connections to Nomatron;
  • makes outbound HTTP requests to the Nomatron API; and
  • makes outbound requests to the Nomad API.

So the normal docker run command does not need -p flags.

The network paths that matter are:

  • container -> Nomatron gRPC endpoint on 4650;
  • container -> Nomatron HTTP API on 4649; and
  • container -> Nomad API for each configured cluster.

If you are running Nomad and the agent on the same private network, verify that the Docker bridge or host network mode you choose does not block access to the Nomad API address configured in the agent file.

File Permissions And Runtime User

The published image runs as a non-root user in a distroless base image.

That is a good default for hardening, but it means:

  • mounted config files must be readable by the container user;
  • mounted certificate files must also be readable; and
  • troubleshooting shell access inside the container is limited because the image is intentionally minimal.

If you need to inspect files or permissions, do that from the host side rather than assuming the container has a shell available.

Container Restart Policy

For long-lived deployments, prefer a restart policy so the agent comes back automatically after host or daemon restarts.

Example:

bash
docker run -d \
  --name nomatron-connectivity-agent \
  --restart unless-stopped \
  -v /etc/nomatron/agent.hcl:/etc/nomatron/agent.hcl:ro \
  -v /etc/nomatron/agent-token:/etc/nomatron/agent-token:ro \
  ghcr.io/nomatronio/nomatron-releases/nomatron-connectivity-agent:v0.1.7 \
  --config /etc/nomatron/agent.hcl

The agent already performs reconnects with backoff if the control-plane session drops, so a container restart policy mainly protects against process exit or host-level restarts.

What Healthy Startup Looks Like

With the default text log format, a healthy v0.1.7 startup looks similar to:

text
==> Nomatron Agent 0.1.7 (aca164ae349b3fbab9cffa1cad52efe2e9309878) 2026-11-14
==> Configuration:
     Agent ID            = 00000000-0000-0000-0000-000000000000
     Nomatron Servers    = nomatron.example.internal:4650
     HTTP Base URLs      = https://nomatron.example.internal:4649
     Config File         = /etc/nomatron/agent.hcl
     Clusters            = 1
[INFO]  nomatron-connectivity-agent: starting Agent: id=00000000-0000-0000-0000-000000000000
[INFO]  nomatron-connectivity-agent: control plane endpoints configured: count=1 servers=["nomatron.example.internal:4650"] http_base_urls=["https://nomatron.example.internal:4649"]
[INFO]  nomatron-connectivity-agent: cluster registry configured: count=1
[INFO]  nomatron-connectivity-agent: agent connected to server: agent_id=00000000-0000-0000-0000-000000000000 server=nomatron.example.internal:4650 http_base_url=https://nomatron.example.internal:4649 cluster_count=1

agent connected to server is the line that confirms the handshake and cluster validation succeeded. If the agent loses the connection later, it logs agent session ended; reconnecting and keeps retrying with backoff (1s up to 30s) instead of exiting.

Verify The Agent Is Working

After startup, verify the runtime from both sides:

On the Docker host

  • the container stays up;
  • the logs show a stable connected state instead of repeated reconnect loops; and
  • there are no cluster validation failures.

Check logs with:

bash
docker logs nomatron-connectivity-agent

In Nomatron

  • the Network Agent appears as connected;
  • the expected private cluster is associated with that agent; and
  • cluster-backed operations no longer fail due to private-network reachability.

Common Failure Modes

ProblemWhat it usually means
The container exits immediately with config errorsThe mounted config file is invalid, incomplete, or unreadable, or has no cluster block (build agent runtime: at least one cluster is required).
The container starts but never connectsNomatron on 4650 or 4649 is unreachable from the container network.
The control plane connection succeeds but the agent still failsCluster validation failed because the configured cluster_id, Nomad API address, ACL token, or TLS settings are wrong.
TLS errors when connecting to NomatronThe control-plane CA file, server name, or TLS trust settings do not match the Nomatron deployment.
Nomad API errors after connectThe agent can reach Nomatron but cannot reach the private Nomad API, or its Nomad credentials are wrong.
Mounted secrets are ignored or fail to loadThe files are not readable by the non-root container user.

For most operators, the cleanest Docker-based pattern is:

  1. keep the agent config file outside the image;
  2. mount the config file into the container read-only;
  3. inject the agent token through a mounted agent_token_file (or NOMATRON_CONNECTIVITY_AGENT_TOKEN from your platform secret mechanism), never inline in the config file;
  4. publish no inbound ports unless you have a very unusual topology; and
  5. use a restart policy so the container survives routine host restarts.

If you want to standardize the same agent runtime under Nomad scheduling, continue to the Nomad job page.