I have a wildfly swarm app running in a docker container in Amazon EC2.
Here is my Docker ps:
913171ca1a34 xxxxxxxxxxx/myrepository:osapp2.0 "java -jar /app/Or..." 55 minutes ago Up 55 minutes 8080/tcp, 0.0.0.0:4000->80/tcp elastic_yonath
netstat -ano | grep 4000 gives following output
tcp 0 0 :::4000 :::* LISTEN off (0.00/0/0)
netstat -ano | grep 80
udp 0 0 fe80::841:a6ff:fe76:c70c:546 :::* off (0.00/0/0)
udp 0 0 :::53880 :::* off (0.00/0/0)
unix 3 [ ] STREAM CONNECTED 9800
I have enabled Port 80 in security Group in my EC2 in inbound
I have removed ::1
from the /etc/hosts
file based on other entires in the StackOverflow.
I am getting when using curl:
"curl http://locahost:4000"
curl: (56) Recv failure: Connection reset by peer
"curl http://localhost:8080"
curl: (56) Recv failure: Connection reset by peer
I am able to run my docker in my local system.
What am I doing wrong?
Here is my IPtables:
sudo iptables -S
-P INPUT ACCEPT
-P FORWARD DROP
-P OUTPUT ACCEPT
-N DOCKER
-N DOCKER-ISOLATION
-A FORWARD -j DOCKER-ISOLATION
-A FORWARD -o docker0 -j DOCKER
-A FORWARD -o docker0 -m conntrack --ctstate RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i docker0 ! -o docker0 -j ACCEPT
-A FORWARD -i docker0 -o docker0 -j ACCEPT
-A DOCKER -d 172.17.0.2/32 ! -i docker0 -o docker0 -p tcp -m tcp --dport 80 -j ACCEPT
-A DOCKER-ISOLATION -j RETURN
i did a netstat -antp, here the port is listed like an IPV6 address ? How can i run my docker with IPV4 configuration
sudo netstat -antp Active Internet connections (servers and established)
Proto Recv-Q Send-Q Local Address Foreign Address
State PID/Program name
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 2294/rpcbind
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 2481/sshd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2511/sendmail
tcp 0 0 0.0.0.0:51501 0.0.0.0:*
LISTEN 2315/rpc.statd
tcp 0 300 172.30.1.61:22 202.60.62.100:39334 ESTABLISHED 4539/sshd
tcp 0 0 :::111 :::* LISTEN 2294/rpcbind
tcp 0 0 :::22 :::* LISTEN 2481/sshd
tcp 0 0 :::36475 :::* LISTEN 2315/rpc.statd
tcp 0 0 :::4000 :::* LISTEN 4431/docker-proxy
http:\localhost
? You know it'shttp://localhost
, right? – stdunbar