Network issue on Docker Swarm

I created a VM and installed Docker as instructed. After that, I started a Swarm cluster the way I always do. My stack goes up normally, but one of the two containers does not access the other. I’ve tested using the curl command.

The same docker-compose that I use in another Swarm cluster, works fine.

Is there any network or firewall configuration to apply?

4 Likes

I’am using this compose:

version: '3'
services:
  nginx:
    image: nginx:latest
    ports:
      - "8080:80"
    restart: always

  net-tools:
    image: nicolaka/netshoot
    restart: always
    command: tail -f /dev/null

For testing:

docker exec -it test_net-tools.1.00nna5i0exopzpqt878fwsvwl curl nginx:80

After a while, I get a dns error. When I ping nginx, the first respons delay about 5 seconds, even inside the net-tools container.

4 Likes