Closed fchris82 closed 1 year ago
Hi did you try to expose the ports? Can you try to use inspect
command to see more information of docker instance?
I do not have to expose them, I call it from another container, and it can see the fake API container. I am pretty sure about it.
Meantime, I looked for another fake API docker image, and I use that one because there is currently time pressure. But thank you for the answer, maybe it is only an unusual problem only at me.
@dotronglong I believe you shoudl reopen this issue. We have the same problem where using docker DHCP doesn't work but calling from the host does work.
hi @hyamanieu , thanks for your comment, I tried to test and here is the result. Since I don't have problem with it, I don't know what happened at your end, could you help to share your issue, so we can work together. For now I will reopen this issue for discussing potential issue.
https://github.com/dotronglong/faker/assets/6072939/0f98a40d-8fd6-4491-9da5-c97771d0adf9
Additionally, I did notice that I haven't updated the version of docker, but it should not cause any problems.
@dotronglong thanks for your trial.
You're trying to curl from your host using localhost
: this works fine.
What doesn't work is using curl from another container within the same network, see response from OP.
he calls curl -v http://test_api:3030/v1/users
from another container, not curl -v http://localhost:3030/v1/users
From another container, using the IP address works fine, only using container name doesn't work.
@hyamanieu Perhaps I missed that part, I would need to ask for more information, however, I remember that in order to have name mapping for hostname, they must be under same network. Could you share to me your whole docker compose files so I can check more on that? From my point of view, I think it is not something we could do with this application.
Close due to not having enough information. Please reopen if you found it necessary.
I will try to work on an minimal example and reopen then
docker-compose.yml
test.json
simple.json
Log:
Curl test:
The simple test is the same. Do you have any idea what is wrong?