How to create internal network between containers that does not connect to external web?
What I have done (without using compose):
I have read “Docker container networking” documentation.
Created “User-defined networks” “bridge network”.
Then I created two containers that are using this network.
I pinged both containers (25% lost?) and then I pinged google.com and the result was the same as before.
Why did I manage to ping google.com in “User-defined network”? How can I create network, where containers can communicate with each other, but not external web (google.com?). How can I do it with compose and without?
What I am trying to do is: I want to allow communication to external web (google.com) only through another container. So I need to add both containers to internal network and one of them to network that ables to communicate to external world.
Additional question: If someone has created such system before then, is it possible to access container that does not have external access localhost website?