In this section, we will learn how to deploy a microservice in a Docker container, but let’s first understand what Docker is.
Docker is container management software. In general, software containers allow you to package your application with all dependencies, including the OS, in one package. Your application runs in isolation in the container in which it is packaged. This reduces discrepancies in environments when developing, testing, and deploying. Since all the dependencies for your application are already resolved and packaged with it, you generally do not run into situations where your application ran fine in a dev/test environment, but failed in production—maybe because some of the dependencies were not met. For example, even if you have developed and tested in the same OS version, in production some of the dependencies may fail because of OS updates.
Docker is the most popular container management technology currently. Docker...