Portal Community
  About Docker networks: Docker networks enable container-to-container communication. Containers on the same user-defined network can reach each other by container name — DNS resolution is built in.

When to Use

Configuration

Connection

FieldTypeDefaultDescription
dockerHoststringunix:///var/run/docker.sockDocker daemon socket path or TCP endpoint.
connectionTypestringunixsocketOne of: unixsocket, tcp, tcptls.
tlsCertPathstringTLS certificate directory. Required for tcptls. optional
timeoutSecondsint30Operation timeout. optional

Operation Fields

FieldTypeBadgeDescription
NetworkIdstringrequiredNetwork ID (full or short) or network name.

Sample Configuration

{
  "resource": "network",
  "operation": "inspect",
  "connection": {
    "dockerHost": "unix:///var/run/docker.sock",
    "connectionType": "unixsocket"
  },
  "NetworkId": "app-backend"
}

Validation Errors

Error CodeConditionResolution
MISSING_INPUTNetworkId field is empty.Provide a network ID or name.
NOT_FOUNDNetwork does not exist.Use network/list to confirm the network name or create it with network/create.
CONFIG_ERRORConnection settings malformed.Check dockerHost and connectionType.
AUTH_FAILEDTLS handshake failed.Verify tlsCertPath certificates.

Output

Success Port

FieldTypeDescription
statusstring"ok" on success.
networkInfo.IdstringFull network ID.
networkInfo.NamestringNetwork name.
networkInfo.DriverstringNetwork driver.
networkInfo.Scopestring"local" or "swarm".
networkInfo.IPAMobjectIPAM configuration including Subnet and Gateway.
networkInfo.ContainersobjectMap of container ID to container network endpoint info (name, IPv4 address).
networkInfo.OptionsobjectDriver-specific options.
networkInfo.LabelsobjectNetwork labels.

Error Port

Fires when inspection fails. Output contains status: "error", errorCode, and errorMessage.

Sample Output

{
  "status": "ok",
  "resource": "network",
  "operation": "inspect",
  "networkInfo": {
    "Id": "a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2c3d4e5f6a1b2",
    "Name": "app-backend",
    "Driver": "bridge",
    "Scope": "local",
    "IPAM": {
      "Config": [{ "Subnet": "172.20.0.0/16", "Gateway": "172.20.0.1" }]
    },
    "Containers": {
      "c3d4e5f6...": {
        "Name": "api-server",
        "IPv4Address": "172.20.0.3/16"
      },
      "d4e5f6a1...": {
        "Name": "db-postgres",
        "IPv4Address": "172.20.0.4/16"
      }
    },
    "Options": {},
    "Labels": { "env": "prod" }
  }
}

Expression Reference

ExpressionReturns
{{ $output.networkInfo.Id }}Full network ID — pass to network/connect or network/disconnect.
{{ $output.networkInfo.IPAM.Config[0].Subnet }}Network subnet CIDR.
{{ Object.keys($output.networkInfo.Containers).length }}Number of containers currently connected to this network.
{{ Object.values($output.networkInfo.Containers).map(c => c.Name) }}Array of container names connected to this network.
{{ $output.networkInfo.Driver }}Driver type — use in compliance assertion.

Node Policies & GuardRails

PolicyEnforcement
Never expose Docker daemon TCP without TLSUse tcptls for remote connections. Plain tcp is blocked in production GuardRail profiles.
Store TLS certificates in Credentials ManagerReference tlsCertPath via {{ $credentials.dockerTlsCertPath }}.
Never interpolate user input into NetworkIdNetwork references must come from trusted variables, not user-supplied input.
Disconnect containers before removing networksCheck networkInfo.Containers before calling network/remove — non-empty containers must be disconnected first.
Always handle the error portWire the NOT_FOUND error port to a network/create branch for idempotent setup workflows.
Restrict container/exec to approved commandsArbitrary exec access is root-equivalent. GuardRail exec policies restrict allowed command prefixes.

Examples

Example 1 — Count Connected Containers

Inspect a network to verify the correct number of containers are connected after a deployment workflow completes.

// After network/inspect:
{{ Object.keys($output.networkInfo.Containers).length }}
// Assert equals expected container count

Example 2 — Pre-Remove Container Check

Before calling network/remove, inspect the network and verify no containers are connected. If any are, route to a disconnect loop first.

// After network/inspect:
{{ Object.keys($output.networkInfo.Containers).length === 0 }}
// true → proceed to network/remove
// false → loop through Containers and call network/disconnect for each

Example 3 — Retrieve Network ID by Name

Look up a network's full ID from its name to use with the Docker API directly via an HTTP Request node.

{
  "resource": "network",
  "operation": "inspect",
  "NetworkId": "app-backend"
}
// Then use: {{ $output.networkInfo.Id }}