ping works but not curl in docker container

Viewed 1696

I have a docker-compose file w/o any network configuration. My understanding is this creates a default bridge network. From within this network I can run:

 $ ping www.google.com

And it works just fine. But if I try:

$ curl https://www.google.com 

It hangs. If I set network_mode to host then it works, but I can no longer reach other containers in the network. I would prefer to use the default bridge network created but at the moment I'm just trying to do some testing and this isn't for production use. How can I allow access to the internet and access to other containers on the network?

1 Answers
Related