Docker Community Forums

Share and learn in the Docker community.

Docker network issue. Getting Started Services curl http://localhost hangs


(Vasquezr) #1

After following the sample:
docker swarm init
docker stack deploy -c docker-compose.yml getstartedlab
with docker-compose:

version: "3"
services:
  web:
    image: vasquezr/get-started:part1
    deploy:
      replicas: 5
      resources:
        limits:
          cpus: "0.1"
          memory: 50M
      restart_policy:
        condition: on-failure
    ports:
      - "80:80"
    networks:
      - webnet
networks:
  webnet:

docker stack ps getstartedlab results in:
[xenos@fedorarv dockersamples]$ docker stack ps getstartedlab
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
qqhcjd01jzz9 getstartedlab_web.1 vasquezr/get-started:part1 fedorarv Running Running 18 minutes ago
z9n52bnzcrc4 getstartedlab_web.2 vasquezr/get-started:part1 fedorarv Running Running 18 minutes ago
8a1pu2knj9qf getstartedlab_web.3 vasquezr/get-started:part1 fedorarv Running Running 18 minutes ago
ts3fas6j2zvf getstartedlab_web.4 vasquezr/get-started:part1 fedorarv Running Running 18 minutes ago
kpntm9uw5j34 getstartedlab_web.5 vasquezr/get-started:part1 fedorarv Running Running 18 minutes ago

however,
when i try to connect through curl http://localhost
or a browser at the same url

it just hangs…
Any ideas ?
Thanks.
Using a Fedora VM no firewall no proxy


(Sfbrown) #2

I am seeing the same behaviour under Arch Linux (not VM) with Docker version 17.05.0-ce, build 89658bed64

$ curl -v localhost
* Rebuilt URL to: localhost/
*   Trying ::1...
* TCP_NODELAY set
* Connected to localhost (::1) port 80 (#0)
> GET / HTTP/1.1
> Host: localhost
> User-Agent: curl/7.54.1
> Accept: */*
>

The same docker-compose.yml works fine on a different (Debian) system, I’m not sure where to begin debugging.


(Pandar00) #3

There seems to be an issue around IPv4 vs. IPv6.

Adding -4 to curl option resolved the issue.
Reference: