Docker Community Forums

Share and learn in the Docker community.

Docker stack network issue

docker
swarm

(Vkrkarthick) #1

i have crated the docker stack file as below, it created the 3 services, as excepted but i am unable to access out side of the host. and its not creating any port also. i am using windows docker, ( 2016 and docker version 17.06.1-ee-1) i have created a overlay network called test01. When i create a this manually via command line it works perfectly. kindly suggest me do i miss anything. i have done docker network create -d overlay test01 and docker swarm init. appart from the below command i have used. Inside the host i am able to connect but from out side i can’t.

version: '3.0'
networks:
 default:
  external:
   name: test01
services:
 mssql:
  image: microsoft/mssql-server-windows-developer
  environment:
   - SA_PASSWORD=Password1
   - ACCEPT_EULA=Y
  ports:
   - 1433:1433
  volumes:
   - c:\Databases:c:\Databases
  deploy:
   placement:
    constraints: [node.labels.os==Windows]
 web:
  image: iiswithdb:latest
  ports:
   - 8080:8080
  deploy:
   replicas: 3
 lbs: 
  image: nginx:latest
  ports:
   - 80: 80
  deploy:
   placement:
    constraints: [node.labels.os==Windows]

:\Users\Administrator>docker service ls
ID                  NAME                MODE                REPLICAS            IMAGE                                             PORTS
19qeljqt3wuf        test_mssql          replicated          1/1                 microsoft/mssql-server-windows-developer:latest   *:1433->1433/tcp
48gamfl4j4rl        test_web            replicated          3/3                 iiswithdb:latest                                  *:8080->8080/tcp
nxycxrigmz4u        test_lbs            replicated          1/1                 nginx:latest                                      *:80->80/tcp

C:\Users\Administrator>docker service ps test_lbs
ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE            ERROR               PORTS
81fm4xplekig        test_lbs.1          nginx:latest        node2               Running             Running 25 minutes ago

C:\Users\Administrator>docker service ps test_web
ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE               ERROR                              PORTS
aivzt7eagf4f        test_web.1          iiswithdb:latest    node1               Running             Running about an hour ago
sny1zf7osibq        test_web.2          iiswithdb:latest    node2               Running             Running about an hour ago
lwzlpaks1b4t         \_ test_web.2      iiswithdb:latest    node2               Shutdown            Failed about an hour ago    "task: non-zero exit (21479434…"
iav5mxqdbzoy        test_web.3          iiswithdb:latest    node3               Running             Running about an hour ago

C:\Users\Administrator>docker service ps test_mssql
ID                  NAME                IMAGE                                             NODE                DESIRED STATE       CURRENT STATE            ERROR               PORTS
pfu8qyw7vqxp        test_mssql.1        microsoft/mssql-server-windows-developer:latest   node2

(Vkrkarthick) #2

any update on this pls