I am invoking REST API using curl for my application running within container.I am unable to access the REST API using curl & getting below message
root@2p1aa752bf12f:/# curl 'http://127.0.0.1' -x $http_proxy
curl: (7) Failed to connect to 127.0.0.1 port 80: Connection refused
I tried multiple ways from within the container but it is not working:
- With IPaddress
- with localhost
However when i do ping test i am able to get the response
root@2p1aa752bf12f:/# ping localhost
localhost (127.0.0.1) 56(84) bytes of data.
64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.033 ms
64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.015 ms
64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.031 ms
Also i would want to invoke REST API running on a different container as well.My containers are connected using Bridge network I can ping it but cannot access REST API using curl.I do not get any response & it hangs
Expecting to invoke REST API from within container & also access REST API exposed in another container