In the microservice architecture, multiple smaller services are used to provide a meaningful enterprise-grade application. The Docker-inspired containerization technology is inherently very lightweight, and hence it plays a vital role in enabling the microservice architecture. By default, the Docker container allows outgoing data traffic, but there is no path for the external world to connect to the services running inside the container. Nonetheless, Docker provides an elegant solution to selectively enable the external world to communicate with the service running inside the container, using the following options of the docker container run command:
--publish, -p |
Publish a container's port to the host |
--publish-all, -P |
Publish all exposed ports to random ports |
Both these options allow the external world to connect to the...