简体   繁体   中英

Docker 1.12 Swarm Overlay Network Published Port

I'm trying to run a rather simple example of a swarm on Docker 1.12:

I have two services:

drupalapp     mastermindg/rpi-apache2php7  
drupaldb      mysql:latest

Drupalapp has published port 80:

"Endpoint": {
        "Spec": {
            "Mode": "vip",
            "Ports": [
                {
                    "Protocol": "tcp",
                    "TargetPort": 80,
                    "PublishedPort": 80
                }
            ]
        },
        "Ports": [
            {
                "Protocol": "tcp",
                "TargetPort": 80,
                "PublishedPort": 80
            }
        ],
        "VirtualIPs": [
            {
                "NetworkID": "5citix4eeoe9isd2ainbt2uvn",
                "Addr": "10.255.0.7/16"
            },
            {
                "NetworkID": "6lgv0o648l7inrbu6abh5ac79",
                "Addr": "10.0.9.4/24"
            }
        ]
    },

I have an overlay network:

swarmed       "Subnet": "10.0.9.0/24",
                "Gateway": "10.0.9.1"

The drupalapp instances are started and stable.

My problem is that even though I see port 80 listening on each node I can't reach port 80 on any host.

How do I connect to drupalapp running on my swarm?

(converting comment into an answer)

There were several issues reported in 1.12 on the service discovery and published ports failing. Pull request #25603 appears to fix a bunch of them and is included in 1.12.1 which was released last week . Note that some users in issue #24789 are still reporting problems even in 1.12.1 so there may still be some edge cases to work out.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM