Cloud API Overview > @adpt/cloud > docker > default > dockerIP
docker.default.dockerIP() method
This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.
Get the IP address of the container, optionally for a specific Docker network.
Signature:
dockerIP(network?: string): string | undefined;
Parameters
Parameter | Type | Description |
---|---|---|
network | string | Name of a Docker network. If network is provided and the container is connected to the network with an IP address, that address will be returned. If the container is not connected to the network, undefined will be returned. If network is not provided, the default container IP address will be returned. |
Returns:
string | undefined
Remarks
The IP addresses that are returned by this function are valid only on the associated Docker network, which is often only associated with a single host node for most Docker network types.