Set up Docker discovery
How Scanopy discovers Docker containers — the default local socket, plus using a socket proxy for restricted access or remote hosts.
Scanopy daemons discover Docker containers by connecting to the Docker API. On the daemon's own host that happens automatically; reaching a restricted API, or one on another machine, needs a proxy.
Before you start
Docker credentials are created under Assets > Credentials and can be pointed at Daemon hostRemote hosts.
Creating a credential, assigning it, and overriding it on an individual host work the same way for every integration — see Creating a credential, Where a credential applies, and Auto-assignment. This guide covers only what is specific to Docker.
What gets discovered
- Running containers, with their names and metadata
- Container networks and published port bindings, including automatically created bridge subnets
- Containerized services, identified from the API rather than from a port scan — so containers that publish nothing to the host are still detected
Containers appear as Docker Container services on their host, and the container-to-host relationship shows up in the Workloads perspective.
Discovery is local to one host: the daemon sees the containers on its own machine, or on the single host a proxy credential points at. See Docker host matching for what that means for deduplication.
Prerequisites
- Docker running on the host whose containers you want to discover
- For direct socket access, the daemon can read
/var/run/docker.sockon its own host - For proxied access, a socket proxy deployed and reachable from the daemon — see Docker Proxy below for supported proxies and the operations they must allow
Choosing a credential type
| Credential type | How it connects | Can be targeted at | Requires daemon |
|---|---|---|---|
| Docker Proxy | Connects over TCP, optionally with TLS. | Daemon hostRemote hosts | 0.16.2 or later |
| Docker Socket | Connects via the daemon's local socket. | Daemon host | 0.16.2 or later |
| Situation | Use |
|---|---|
| Daemon runs on the Docker host and may hold full API access | Nothing — the local socket is used automatically |
| Daemon runs on the Docker host, but the socket is at a non-default path | Docker Socket |
| You want to restrict which API operations the daemon can call | Docker Proxy, with the proxy on the same host |
| Docker runs on a machine with no daemon | Docker Proxy, with the proxy on that machine |
Docker Proxy
A socket proxy sits in front of the Docker socket and allows only the API operations you permit. One credential type covers both reasons to use one — restricting local access, and reaching Docker on another machine — since only the address changes.
To discover containers on a machine with no daemon: deploy a proxy there, create a Docker Proxy credential with its port, and assign it to that host. Containers are then reported as services on the remote host.
| Field | Required | Default | Description |
|---|---|---|---|
| Connection | |||
| Docker API Port | Optional | 2375 | Docker API port. Use 2375 for non-TLS proxies (Tecnativa, HAProxy) or 2376 for TLS. |
| URL Path Prefix | Optional | None | Optional URL path prefix appended after the port |
| TLS | |||
| SSL Certificate | Optional | None | PEM-encoded client certificate. All three TLS fields (cert, key, CA chain) must be provided together. |
| SSL Private KeySecret | Optional | None | PEM private key. All three TLS fields must be provided together. |
| SSL CA Chain | Optional | None | PEM-encoded CA certificate chain. All three TLS fields must be provided together. |
The TLS fields apply to HTTPS proxies only. Each can be entered inline or as a file path readable by the daemon.
Supported proxies
Scanopy has been tested with these socket proxies.
Tecnativa docker-socket-proxy
services:
docker-proxy:
image: tecnativa/docker-socket-proxy
environment:
- CONTAINERS=1 # Required: list and inspect containers
- NETWORKS=1 # Required: list networks for subnet discovery
- EXEC=1 # Required: exec into containers for endpoint probing
- POST=1 # Required: create exec instances
- INFO=1 # Optional: system info
- BUILD=0
- COMMIT=0
- CONFIGS=0
- DISTRIBUTION=0
- GRPC=0
- IMAGES=0
- NODES=0
- PLUGINS=0
- SECRETS=0
- SERVICES=0
- SESSION=0
- SWARM=0
- SYSTEM=0
- TASKS=0
- VOLUMES=0
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- '2375:2375'wollomatic socket-proxy
services:
docker-proxy:
image: wollomatic/socket-proxy
environment:
- ALLOW_RESTARTS=0
- LOG_LEVEL=info
volumes:
- /var/run/docker.sock:/var/run/docker.sock:ro
ports:
- '2375:2375'wollomatic's proxy uses allowlists rather than per-capability flags. Refer to their documentation for configuring the endpoints below.
Required API operations
Whatever proxy you use, allow these endpoints:
| Endpoint | Method | Purpose |
|---|---|---|
/containers/json | GET | List running containers |
/containers/{id}/json | GET | Get container details (ports, networks, config) |
/networks | GET | List networks for subnet discovery |
/exec/{id}/json | GET | Check exec instance status |
/containers/{id}/exec | POST | Create exec instance for endpoint probing |
/exec/{id}/start | POST | Start exec to probe HTTP endpoints inside containers |
Why exec? Scanopy uses exec to probe HTTP endpoints from inside containers that don't publish ports to the host. Without exec access, containers are still discovered but service detection is less accurate.
Docker Socket
The daemon connects directly to /var/run/docker.sock on its own host. This needs no credential and no toggle — the daemon uses the socket whenever it's accessible.
Create a Docker Socket credential only to point the daemon at a socket somewhere other than the default path.
| Field | Required | Default | Description |
|---|---|---|---|
| Socket Path | Optional | None | Path to the Docker Unix socket. Leave blank to auto-detect (DOCKER_HOST or /var/run/docker.sock). |
Because the socket is reachable only over the daemon's own loopback, this credential type can be assigned to a daemon host and nowhere else.
Verifying it works
- Go to Discover > Scan > Scheduled and run a discovery, or wait for the next scheduled run
- Open the host running Docker and go to its Services tab
- Look for Docker Container services, each with its published ports
- Open the Workloads perspective and confirm the containers appear nested under their host
Troubleshooting
"Connection refused" to proxy
- Verify the proxy is running:
docker ps | grep proxy - Check the proxy is listening:
curl http://docker-proxy:2375/version - Ensure the daemon can reach it — same Docker network, or an exposed port
"Permission denied" from proxy
The proxy is blocking a required endpoint. For Tecnativa, confirm CONTAINERS=1, NETWORKS=1, EXEC=1, and POST=1 (the last is required for exec).
SSL certificate errors
- Verify certificate paths are correct and mounted
- Check the certificate is valid:
openssl x509 -in /certs/client-cert.pem -text -noout - Include the CA chain if using self-signed certs
- Check that the cert and key aren't swapped
For diagnosing credential loading and file read or PEM errors from daemon logs, see Credential troubleshooting.
Set up UniFi discovery
Connect a UniFi Network Application controller so Scanopy can discover the switches, access points and gateways it manages, along with their ports and LLDP neighbors.
Set up Podman discovery
How Scanopy discovers Podman containers and pods, via the local socket or a remote Podman API proxy.