From a9d8ec0b1e36bfb1da0e13000fe656590774bd07 Mon Sep 17 00:00:00 2001 From: Nemental <15136847+Nemental@users.noreply.github.com> Date: Wed, 30 Jul 2025 15:28:55 +0200 Subject: [PATCH] docs: update docker socket part --- README.md | 25 +++++++++++++++++++++++-- main.go | 2 +- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 69a4fa8..8e03c2a 100644 --- a/README.md +++ b/README.md @@ -205,7 +205,27 @@ Newt can integrate with the Docker socket to provide remote inspection of Docker **Configuration:** -You can specify the Docker socket path using the `--docker-socket` CLI argument or by setting the `DOCKER_SOCKET` environment variable. On most linux systems the socket is `/var/run/docker.sock`. When deploying newt as a container, you need to mount the host socket as a volume for the newt container to access it. If the Docker socket is not available or accessible, Newt will gracefully disable Docker integration and continue normal operation. +You can specify the Docker socket path using the `--docker-socket` CLI argument or by setting the `DOCKER_SOCKET` environment variable. If the Docker socket is not available or accessible, Newt will gracefully disable Docker integration and continue normal operation. + +Supported values include: + +- Local UNIX socket (default): + >You must mount the socket file into the container using a volume, so Newt can access it. + + `unix:///var/run/docker.sock` + +- TCP socket (e.g., via Docker Socket Proxy): + + `tcp://localhost:2375` + +- HTTP/HTTPS endpoints (e.g., remote Docker APIs): + + `http://your-host:2375` + +- SSH connections (experimental, requires SSH setup): + + `ssh://user@host` + ```yaml services: @@ -219,8 +239,9 @@ services: - PANGOLIN_ENDPOINT=https://example.com - NEWT_ID=2ix2t8xk22ubpfy - NEWT_SECRET=nnisrfsdfc7prqsp9ewo1dvtvci50j5uiqotez00dgap0ii2 - - DOCKER_SOCKET=/var/run/docker.sock + - DOCKER_SOCKET=unix:///var/run/docker.sock ``` +>If you previously used just a path like `/var/run/docker.sock`, it still works — Newt assumes it is a UNIX socket by default. #### Hostnames vs IPs diff --git a/main.go b/main.go index dbb141f..14c74d3 100644 --- a/main.go +++ b/main.go @@ -158,7 +158,7 @@ func main() { flag.StringVar(&tlsPrivateKey, "tls-client-cert", "", "Path to client certificate used for mTLS") } if dockerSocket == "" { - flag.StringVar(&dockerSocket, "docker-socket", "", "Path to Docker socket (typically /var/run/docker.sock)") + flag.StringVar(&dockerSocket, "docker-socket", "", "Path or address to Docker socket (typically unix:///var/run/docker.sock)") } if pingIntervalStr == "" { flag.StringVar(&pingIntervalStr, "ping-interval", "3s", "Interval for pinging the server (default 3s)")