docker swarm access service

How to access swarm services on a multi-host docker swarm.

For a docker swarm, lets say that the services are named: abc, pqr, xyz

  • In Docker-compose, don't see the host names of other services
  • Jenkinsfile Pipeline do something when some checked-in file is changed / newly checked out / run in a fresh node
  • Is there a way to make a bootable Linux live USB disk from a Linux docker container?
  • What do the curly braces mean in docker inspect --format “{{.State.Pid}}”?
  • Having two images of docker for production and development
  • How can we use shared Dockerfile's which reside in different directories than the “current build context path”?
  • If the services are placed in the same host, they are able to access by http://pqr/a or http://xyz/a

    but if they are on different host they are not able to access by http://pqr/a or http://xyz/a. Even ping to the other service names are not working.

    docker service create --constraint 'node.labels.momachinename == t4301' --name abc --network=ni_default mo-vo:7.10.0s node /a/src/start.js
    docker service create --constraint 'node.labels.momachinename == t4302' --name pqr --network=ni_default mo-vo:7.10.0s node /a/src/start.js
    docker network ls
    NETWORK ID          NAME                DRIVER              SCOPE
    d7478273de19        bridge              bridge              local
    485112e08c0f        docker_gwbridge     bridge              local
    c8a75eb27f1f        host                host                local
    5rmqgswur2lp        ingress             overlay             swarm
    q26p8tdr0xw6        networld            overlay             swarm
    d2kf3bfdbmol        ni_default          overlay             swarm
    64094b86b804        none                null                local

  • How to completely destroy docker container from marathon UI?
  • LDAP-Server with official docker support
  • How to get JSF working with spring-boot app in docker container?
  • How to deploy secure web application using docker on bluemix
  • Docker port bindings
  • Make 2 volumes in docker gcc and java
  • One Solution collect form web for “docker swarm access service”

    From your symptoms, it sounds like you have the containers running on the same overlay network and can communicate using DNS resolution on the same host, but you’re just having problems between hosts. For overlay networking between hosts, you need the following firewall rules:

    iptables -A INPUT -p tcp -m tcp --dport 7946 -j ACCEPT
    iptables -A INPUT -p tcp -m udp --dport 7946 -j ACCEPT
    iptables -A INPUT -p tcp -m tcp --dport 4789 -j ACCEPT
    iptables -A INPUT -p 50 -j ACCEPT

    That’s port 7946 for tcp/udp (this is the control port), port 4789 for tcp (this is the data port), and protocol 50 (needed for secure networks using IPSEC).

    Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.