'DotNet5 Integration Test from original Docker image

I should write an integration test to verify the operation of my libraries which query (CRUD) an API server located on Docker. Since the library is also in writing, I would need that at each test on docker was reset in order to start from the original image, otherwise my tests would be all dependent as the data at each call would be modified. How could I make my docker image start from its original state between one test case and the next?

For reading operations I resolve using a specific image as it will never be modified.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source