What are methods to make Docker work faster when using it for tests?

Viewed 32

My ultimate goal is to create a test environment where auxiliary services (microservices, databases, message queues, etc) could be easily provided in clean state for each test.

Currently I achieved somewhat fast operation times by not doing docker run ..., docker rm ... for each container but instead putting all the mutable data on to a volume and do docker start ..., docker stop ..., <remove data from volume>, docker start .... It is faster, but still not satisfactory in practice - test runs take too long time if the amount of tests is big.

So currently I know only one approach to speed up re-creation of Docker containers:

  1. Use a volume with mutable data and clean it up between start/stop instead of doing full re-creation.

What are other possible approaches?

0 Answers
Related