Docker Community Forums

Share and learn in the Docker community.

Google chrome and localhost in swarm mode


(Jambonnade) #1

Hi,

I have the following tiny issue : google chrome (chromium actually) can’t connect to the http services in my containers in my local swarm using “localhost” domain.
It’s really specific : only with localhost (other domain aliases or 127.0.0.1 work), only with chrome (firefox and wget are ok) and only from containers in a service stack (it works when i run a container directly).
It’s really not critical but i’d like to understand, and networking is not what i know most.

The stack has nothing special : there are 3 different services linked together by the implicit automatic network. It’s merely what we can see in the getting started guides, except i used “mode: global” for the “deploy” parameters.

Everything run on the same computer, on Ubuntu 16
Docker Server Version: 17.03.1-ce

$ docker network ls
NETWORK ID          NAME                     DRIVER              SCOPE
32562cc1e37a        bridge                   bridge              local
63057fc50251        docker_gwbridge          bridge              local
a3fcb51d7269        host                     host                local
ha4btuki0jtc        ingress                  overlay             swarm
r9ho0gy0v6ub        my-local-stack_default   overlay             swarm
673761bc23d3        none                     null                local
$ netstat -n
Table de routage IP du noyau
Destination     Passerelle      Genmask         Indic   MSS Fenêtre irtt Iface
default         192.168.0.254   0.0.0.0         UG        0 0          0 wlp3s0
link-local      *               255.255.0.0     U         0 0          0 docker_gwbridge
172.17.0.0      *               255.255.0.0     U         0 0          0 docker0
172.18.0.0      *               255.255.0.0     U         0 0          0 docker_gwbridge
192.168.0.0     *               255.255.255.0   U         0 0          0 wlp3s0

(Daniloarcidiacono) #2

Hi, I’m facing exactly the same problem (Docker version 17.09.0-ce, build afdb6d4), it’s a very weird behaviour.
Any tips?


(Jhnoor) #3

Also facing the exact same problem, would be great if anyone with greater network experience can explain this.


(Breitsmiley) #4

I also have the same problem. It can be checked as

docker service create \
--name test \
--replicas 1 \
-p 8080:80 \
nginx

After run this service try to open localhost:8080 in Google Ghrome.

My version of docker

$ docker version
Client:
 Version:      17.11.0-ce
 API version:  1.34
 Go version:   go1.8.3
 Git commit:   1caf76c
 Built:        Mon Nov 20 18:37:39 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.11.0-ce
 API version:  1.34 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   1caf76c
 Built:        Mon Nov 20 18:36:09 2017
 OS/Arch:      linux/amd64
 Experimental: false

(Wizardmerlin) #5

I’m facing the exact same problem.

$ docker version
Client:
 Version:      17.03.1-ce
 API version:  1.27
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Mon Mar 27 17:14:09 2017
 OS/Arch:      linux/amd64

Server:
 Version:      17.03.1-ce
 API version:  1.27 (minimum version 1.12)
 Go version:   go1.7.5
 Git commit:   c6d412e
 Built:        Mon Mar 27 17:14:09 2017
 OS/Arch:      linux/amd64

I’m using Chrome.

$ google-chrome --version
Google Chrome 59.0.3071.86 

My OS is Ubuntu.

$ uname -a
Linux xxx 4.4.0-104-generic #127-Ubuntu SMP Mon Dec 11 12:16:42 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

Any solution or workaround?


(Jason8898) #6

The problem that you can’t connect to the http services in my containers in my local swarm using “localhost” domain seems pretty hard to solve. You should check out this website Chrome ERR_CONNECTION_RESET Error for solution to your problem. Hope this helps.