host machine. although it works from within the container itself using docker exec
container is up and running. outputs:
$ curl http://localhost:7171/backup/list
curl: (56) Recv failure: Connection reset by peer
$ curl http://121.121.121.19:7171/backup/list
curl: (7) Failed to connect to 121.121.121.19 port 7171 after 0 ms: Connection refused
$ nc -zv 121.121.121.19 7171
nc: connect to 121.121.121.19 port 7171 (tcp) failed: Connection refused
my docker-compose:
my-service:
image: inc/something:latest
container_name: name
hostname: host_name
restart: always
networks:
project-network:
ipv4_address: 121.121.121.19
networks:
project-network:
name: project-network
ipam:
config:
- subnet: 121.121.121.0/20
i also have this in docker inspect:
"Ports": {
"7171/tcp": [
{
"HostIp": "0.0.0.0",
"HostPort": "7171"
},
{
"HostIp": "::",
"HostPort": "7171"
}
]
},
(IP's are modified, i type them in correctly in my actual commands)
netstat -tuln inside container:
tcp 0 0 127.0.0.1:7171 0.0.0.0:* LISTEN
on the host machine:
tcp 0 0 0.0.0.0:7171 0.0.0.0:* LISTEN
tcp6 0 0 :::7171 :::* LISTEN
i suspect that it's a firewall issue? because everything else seems ok
What OS you are using?
ubuntu 20.04 LTS
Have you turn off the firewall?
Обсуждают сегодня