Creating a Docker network

We are going to deploy two servers in two separate Docker containers in the same machine: a MySQL DB server and an application server to run our microservice. The application server will need to know about the DB server to access it. The recommended way to allow two Docker containers to access each other is by deploying them in the same Docker network. A complete discussion of Docker networks is out of scope of this book, so readers are encouraged to read about Docker networks at https://docs.docker.com/engine/userguide/networking.

Knowing that the two containers we are going to create shortly need to run in the same Docker network, let’s create a Docker network by running the following command:

docker network create --driver bridge coursemanagement

In this command, coursemanagment is the name of the network we are creating.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.16.76.138