Docker Community Forums

Share and learn in the Docker community.

Why does the host always response `RST` though the server is listening on the port?


(Nanxiao) #1

My OS is RHEL7, and the docker version is 1.5.0.

I am using gitlab docker image to deploy a service, and the web port is 8080 on host. After running the gitlab, I can see the port is OK:

CONTAINER ID        IMAGE                  COMMAND                CREATED             STATUS                      PORTS                                        NAMES
b85d87da48df        genezys/gitlab:7.5.2   "/bin/sh -c 'gitlab-   25 minutes ago      Up 25 minutes               0.0.0.0:2222->22/tcp, 0.0.0.0:8080->80/tcp   gitlab_app

The netstat command also diplays OK:

[root@localhost backup]# netstat -nlp | grep 8080
tcp6       0      0 :::8080                 :::*                    LISTEN      12489/docker-proxy

But the web browser can’t connect the 8080 successfully (http://10.137.20.112:8080/), and the tcpdump output likes this:

[root@localhost ~]# tcpdump -i enp2s0f1 port 8080 -vv
tcpdump: listening on enp2s0f1, link-type EN10MB (Ethernet), capture size 65535 bytes
02:40:00.808034 IP (tos 0x0, ttl 128, id 4031, offset 0, flags [DF], proto TCP (6), length 52)
	perfls15.americas.hpqcorp.net.53178 > 10.137.20.112.webcache: Flags [S], cksum 0x17d1 (correct), seq 997417494, win 8192, options [mss 1460,nop,wscale 2,nop,nop,sackOK], length 0
02:40:00.808141 IP (tos 0x0, ttl 63, id 0, offset 0, flags [DF], proto TCP (6), length 40)
	10.137.20.112.webcache > perfls15.americas.hpqcorp.net.53178: Flags [R.], cksum 0x788a (correct), seq 0, ack 997417495, win 0, length 0
02:40:01.322048 IP (tos 0x0, ttl 128, id 4032, offset 0, flags [DF], proto TCP (6), length 52)
	perfls15.americas.hpqcorp.net.53178 > 10.137.20.112.webcache: Flags [S], cksum 0x17d1 (correct), seq 997417494, win 8192, options [mss 1460,nop,wscale 2,nop,nop,sackOK], length 0
02:40:01.322123 IP (tos 0x0, ttl 63, id 0, offset 0, flags [DF], proto TCP (6), length 40)
	10.137.20.112.webcache > perfls15.americas.hpqcorp.net.53178: Flags [R.], cksum 0x788a (correct), seq 0, ack 1, win 0, length 0
02:40:01.821289 IP (tos 0x0, ttl 128, id 4033, offset 0, flags [DF], proto TCP (6), length 48)
......

I can’t see why the host always responses RST, could anyone give some debugging clues?

BTW, I also posted the issue on SO, but unfortunately, there is no clues. So I repost it here, thanks!