Docker offers an excellent option when it comes to creating and destroying containers very quickly, with the same exact contents. This way, you can be pretty sure that things will work as you expect them to!
Docker support comes built in for ASP.NET Core projects. When you create one, you get a Dockerfile in your project. It will contain something like this:
FROM mcr.microsoft.com/dotnet/core/aspnet:3.1
ARG source
WORKDIR /app
EXPOSE 80
COPY ${source:-obj/Docker/publish} .
ENTRYPOINT ["dotnet", "MyApplication.dll"]
Notice an extra solution folder called docker-compose. Docker Compose is the tool used to define and run multi-container Docker applications and you can read about it at: https://docs.docker.com/compose. In this folder, you will find three files:
- docker-compose.ci.build.yml: A Docker Compose file to be used for Continuous Integration (CI)
- docker-compose.yml: A base Docker Compose...