docker群端口发布不映射

我试图启动一个docker服务,但它不听localhost:8080。

$ docker service create --name webn -p 8080:80 nginx 6dgys45184b2hjyj1r9sclt Since --detach=false was not specified, tasks will be created in the background. In a future release, --detach=false will become the default. $ docker ps CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES ce52d71684ff nginx "nginx -g 'daemon ..." 4 seconds ago Up 2 seconds 80/tcp webn.1.oz4g41puc678n8j7sv3h 

初始化群集时,我必须select一个IP地址,也许这是问题的一部分:

 $ docker swarm init Error response from daemon: could not choose an IP address to advertise since this system has multiple addresses on interface enp2s0 (xxxx:xxxx:xxxx:xxx:xxxx:xxxx:xxxx:5450 and xxxx:xxxx:xxxx:xxx:xxxx:xxxx:xxxx:fbb8) 

所以我尝试join这两个地址群,但服务仍然不听localhost:8080