2

How to create the Docker network so that the container expose ports only for the host and have no access to the internet and to the other containers?

I found the solution for restricting access to internet, but it allows containers to interact with each other.

halfer
  • 19,824
  • 17
  • 99
  • 186
anton
  • 675
  • 6
  • 16
  • 3
    To limit access between containers, use Docker Compose with custom networks. Add containers to the networks of other containers they need to see. – halfer Nov 05 '18 at 07:23
  • 1
    In the example you linked, containers can only communicate with containers in the same network. If you write docker-compose with 1 network and 1 container it will solve your problem. – jazgot Nov 05 '18 at 07:49

0 Answers0