1
試圖在Docker Swarm集羣上運行Couchbase集羣。集羣啓動後,我想動態獲取每個Couchbase實例的IP地址。 docker inspect
顯示:在Docker Swarm集羣上訪問Couchbase容器的IP地址
"NetworkSettings": {
"Bridge": "",
"SandboxID": "325807d55b552be3fe5b44b4d975c2486b3a56b320aa56fa0367e42348b82d64",
"HairpinMode": false,
"LinkLocalIPv6Address": "",
"LinkLocalIPv6PrefixLen": 0,
"Ports": {
"11207/tcp": null,
"11210/tcp": [
{
"HostIp": "192.168.99.101",
"HostPort": "11210"
}
],
試圖訪問的IP地址,給出了錯誤:
docker inspect --format '{{ .NetworkSettings.Ports.8091/tcp[0].HostIp }}' 922755302fef
Template parsing error: template: :1: unexpected ".8091" in operand; missing space?
什麼是訪問的IP地址正確的格式?