Authoring a Dockerfile
A Dockerfile is a text file that outlines how a Docker image should be built. The language used is Yet Another Markup Language (YAML), which is a popular markup language used for configuration files. This file usually contains the following elements:
- A base or parent image to base the new image on
- Commands to update the operating system and additional software and plugins as needed
- Compiled application assets to be included in the image
- Additional container image assets for storage and networking needs
- A command to run the application when the container launches
In our case, we are building a microservices-based application with several web services. This means that we need to author Dockerfiles per web service. Since all our services are ASP.NET Core based, we can use the following example of a Dockerfile as a base example for our appointment web service and others.
To add a Dockerfile to our project, we can use Visual Studio...