docker 1.12 swarm cluster cannot serve static files

I had a swarm cluster based on docker 1.12.1 swarm mode.
There are 3 master node and 3 worker node. I have a node.js/express service running upon the cluster.

The service has 5 replicas and public port 8082.
But when i try to access it, it failed if serve static files.

  • Cannot configure Maven connection from KIE server to Drools workbench using docker-compose
  • Browsersync within a Docker container
  • Can't start docker service after updating to 1.12.6-176.1 in OpenSUSE:
  • docker-compose gives ERROR: Cannot locate specified Dockerfile: Dockerfile
  • How to send a curl in Docker Remote API?
  • How to expose a docker machine to an internal network
  • I use curl to fetch one static style script from the service as an example.

    [root@i1-proxy ~]# time curl -v 192.168.100.3:8082/dist/style.css
    * About to connect() to 192.168.100.3 port 8082 (#0)
    *   Trying 192.168.100.3...
    * Connected to 192.168.100.3 (192.168.100.3) port 8082 (#0)
    > GET /dist/style.css HTTP/1.1
    > User-Agent: curl/7.29.0
    > Host: 192.168.100.3:8082
    > Accept: */*
    >
    < HTTP/1.1 200 OK
    < X-Powered-By: Express
    < Accept-Ranges: bytes
    < Cache-Control: public, max-age=0
    < Last-Modified: Fri, 02 Sep 2016 02:09:20 GMT
    < ETag: W/"106e1-156e8a85080"
    < Content-Type: text/css; charset=UTF-8
    < Content-Length: 67297
    < Date: Mon, 05 Sep 2016 02:50:14 GMT
    < Connection: keep-alive
    <
    * Recv failure: Connection reset by peer
    * Closing connection 0
    curl: (56) Recv failure: Connection reset by peer
    
    real    4m0.657s
    user    0m0.019s
    sys     0m0.012s
    

    It returns the HTTP headers but no HTTP body.

    Add:

    docker info of one master in cluster

    Containers: 1
     Running: 1
     Paused: 0
     Stopped: 0
    Images: 12
    Server Version: 1.12.1
    Storage Driver: aufs
     Root Dir: /var/lib/docker/aufs
     Backing Filesystem: extfs
     Dirs: 59
     Dirperm1 Supported: true
    Logging Driver: json-file
    Cgroup Driver: cgroupfs
    Plugins:
     Volume: local
     Network: bridge overlay null host
    Swarm: active
     NodeID: 99wq9cba397bps7578fxqijq1
     Is Manager: true
     ClusterID: 73oimnw1q8zh9caof3gk6sutw
     Managers: 3
     Nodes: 6
     Orchestration:
      Task History Retention Limit: 5
     Raft:
      Snapshot Interval: 10000
      Heartbeat Tick: 1
      Election Tick: 3
     Dispatcher:
      Heartbeat Period: 5 seconds
     CA Configuration:
      Expiry Duration: 3 months
     Node Address: 192.168.100.3
    Runtimes: runc
    Default Runtime: runc
    Security Options: seccomp
    Kernel Version: 4.4.0-34-generic
    Operating System: Ubuntu 16.04.1 LTS
    OSType: linux
    Architecture: x86_64
    CPUs: 4
    Total Memory: 7.796 GiB
    Name: i-yyk6gta5
    ID: VXWN:I4AA:EIY7:4NKF:OQJW:GLIJ:43TJ:L6FO:RQB4:Z4L2:6A7D:EGIP
    Docker Root Dir: /var/lib/docker
    Debug Mode (client): false
    Debug Mode (server): false
    Registry: https://index.docker.io/v1/
    WARNING: No swap limit support
    Insecure Registries:
     127.0.0.0/8
    

    And docker version

    Client:
     Version:      1.12.1
     API version:  1.24
     Go version:   go1.6.3
     Git commit:   23cf638
     Built:        Thu Aug 18 05:33:38 2016
     OS/Arch:      linux/amd64
    
    Server:
     Version:      1.12.1
     API version:  1.24
     Go version:   go1.6.3
     Git commit:   23cf638
     Built:        Thu Aug 18 05:33:38 2016
     OS/Arch:      linux/amd64
    

  • HBase 1.2.1 standalone in Docker unable to connect
  • Docker container not connecting to https endpoints
  • Connection Failing to Docker Container
  • Kibana on Docker cannot connect to Elasticsearch
  • Switching app versions with docker container
  • Jelastic Docker Nginx LoadBalancing with Horizontal Auto Scaling
  • Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.