docker-apim icon indicating copy to clipboard operation
docker-apim copied to clipboard

API console not working as it is pointing to random IP

Open winster opened this issue 7 years ago • 6 comments

This is the api overview.

Production and Sandbox URLs: http://172.17.0.2:8280/phoneverify/2.0.0 https://172.17.0.2:8243/phoneverify/2.0.0

But this is a wrong IP (might be the ip of docker container). But from my host machine, not able to hit it hence API call time out.

Added: It works fine with downloader.

winster avatar Apr 09 '18 10:04 winster

@winster Cloud you please mention which deployment pattern is related to this issue.

ThilinaManamgoda avatar Apr 16 '18 07:04 ThilinaManamgoda

docker

winster avatar Apr 16 '18 14:04 winster

@winster Deployed APIs can be invoked If you spawn the container using the following command, docker run -p 9443:9443 -p 8243:8243 wso2am:2.2.0

ThilinaManamgoda avatar Apr 18 '18 10:04 ThilinaManamgoda

@ThilinaManamgoda , @winster I see that my Production and Sandbox Endpoints are pointing to http://172.17.0.2:8280/xxx/yyy Docker here as well. Also new to docker and wso2. Can you please elaborate the solution? thanks ahead...

prats2017 avatar Aug 23 '19 19:08 prats2017

@prats2017 In this case APIM is picking up the container IP as the host. That is why it showing 172.17.0.2 as the host. Containers are spawned in a separate network which cannot be accessed form outside world. In order to access the ports exposed by a container it is required to map exposed ports to host ports(That's what we are doing with -P).

ThilinaManamgoda avatar Aug 25 '19 14:08 ThilinaManamgoda

Thanks @ThilinaManamgoda Thanks for responding. I see what you are saying.

docker inspect --format='{{ .NetworkSettings.IPAddress }}' d3ae95cfbbd1 172.17.0.2 docker inspect --format='{{ .NetworkSettings.Gateway }}' d3ae95cfbbd1 172.17.0.1

I am new to Docker too. So, am reading how docker container, image etc works. Meanwhile can you pls provide command to map exposed ports to host ports. This will help me understand this whole thing better and quicker.

prats2017 avatar Aug 26 '19 17:08 prats2017