Running a Docker container
In this section, you will take the Cargo Tracker application, build a Docker file for it, and run it as a Docker container on your system. We will start by creating a Docker file that you can use. Using the Docker file, we will tell Docker Engine how to create the container for us and how we want to run it. With the container running, we will look at how to use the command-line interface to manage the container to see the logs generated by the Cargo Tracker application. The creation of this Docker file will be the starting point of our journey toward running the Cargo Tracker on Docker.
Creating a Docker container
The first step to run the Cargo Tracker on Docker Engine is to create a Docker file. The Docker file contains instructions for Docker Engine on how to create the container we want. Start by creating a file named Dockerfile
in the root of the Cargo Tracker application. Inside the Docker file, you need to add the following two lines of code...