Trying to run a Couchbase cluster on Docker Swarm cluster.
Once the cluster is started, I want to obtain the IP address of each Couchbase instance dynamically.
docker inspect gives this:
"NetworkSettings": {
"Bridge": "",
"SandboxID": "325807d55b552be3fe5b44b4d975c2486b3a56b320aa56fa0367e42348b82d64",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"11207/tcp": null,
"11210/tcp": [
{
"HostIp": "192.168.99.101",
"HostPort": "11210"
}
],
Trying to access the IP address gives the error:
docker inspect --format '{{ .NetworkSettings.Ports.8091/tcp[0].HostIp }}' 922755302fef
Template parsing error: template: :1: unexpected ".8091" in operand; missing space?